Skip to main content

Pivotal UI

v18.0.0
Components / Theme provider

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 defined
Using a light ThemeProvider
ReferenceError: React is not defined

Props

PropertyRequiredTypeDefaultDescription
themefalseoneOf(['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';