I have an app that I started developing recently and I'm considering moving over to react-rainbow. Is there a way to set a color theme for all react-rainbow components?
React-rainbow components color theme
1k views Asked by Yuliet Garcia At
2
There are 2 answers
0
On
Customization is allowed by using the <Application /> component as a wrapper of your entire application, the component property theme will accept an object where you can specify your palette of colors.
const theme = {
rainbow: {
palette: {
brand: '#5c56b6',
},
},
};
<Application theme={theme}>
<Button
label="Button Brand"
onClick={() => alert('clicked!')}
variant="brand"
/>
...
</Application>
You can find more documentation here https://react-rainbow.io/#/Customization
First, you have to create an object with the customizations you want to add, then you import Application from react-rainbow-components and wrap your components with Application. Finally, you pass your customizations object as the prop theme to Application. This is an example.