Using Themes

How themes are provided

To get started with theming, wrap your application in the ThemeProvider. Note: You only need one ThemeProvider in your application. However if you like to change your theme deep in your component tree, you can nest.

How to theme a component

To make a component themable a higher-order-component (HoC) is provided. With this HoC you can wrap your component.

Simply wrap a component with withTheme and a property theme gets passed:

You can also directly map the theme values to the properties via the second parameter mapThemeToProps. All other properties will also be passed through.

Example