Theme provider
The ThemeProvider component will make all buttons anywhere inside of the ThemeProvider use the associated theme without needing to set the onDark prop. Note that as of now this is only detected by Button components.
Using a dark ThemeProvider
ReferenceError: React is not definedUsing a light ThemeProvider
ReferenceError: React is not definedProps
| Property | Required | Type | Default | Description |
|---|---|---|---|---|
theme | false | oneOf(['light', 'dark']) | 'light' | The theme all children components should adhere to. |
Imports
Import React components (including CSS):
import {ThemeProvider} from 'pivotal-ui/react/theme-context';
Import CSS only:
import 'pivotal-ui/css/theme-context';