StyleProvider
Provides theme context, sets bare minimum global styles, and wraps content with styles from theme.styles.root.
import { StyleProvider } from '@cozmos-ui/core';
Basic Use
Wrap the main <App /> component and provide a theme.
import ReactDOM from 'react-dom';import App from './App';import { StyleProvider } from '@cozmos-ui/core';import { radium } from '@cozmos-ui/themes';ReactDOM.render(<StyleProvider theme={radium}><App /></StyleProvider>,document.getElementById('root'));
Props
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| children | element | Yes | --- | This should be the main <App /> component. |
| theme | object | No | {} | --- |