@cebus/react-switch
v0.0.3
Published
The Switch allows users to toggle a value between an on and off state.
Downloads
16
Readme
Switch
The Switch allows users to toggle a value between an on and off state.
Use
- Install the @cebus/react-switch component.
Using NPM
npm install @cebus/react-switch
Using Yarn
yarn add @cebus/react-switch
Install the @cebus/react-provider and our theme tokens from @cebus/react-theme
Set up the provider in your app:
import { Provider } from '@cebus/react-provider'
import { webLightTheme } from '@cebus/react-theme'
const MyApp = () => {
return (
<Provider theme={webLightTheme}>
<Provider>
)
}
- Integrate the Switch component.
import { Provider } from '@cebus/react-provider'
import { webLightTheme } from '@cebus/react-theme'
import { Switch } from '@cebus/react-switch'
const MyApp = () => {
return (
<Provider theme={webLightTheme}>
<Switch/>
<Provider>
)
}
API
To learn more about the Switch API take a look at the Switch Interface file.