@pongo-ui/react-switch
v0.0.11
Published
The Switch allows users to toggle a value between an on and off state.
Downloads
4
Readme
Switch
The Switch allows users to toggle a value between an on and off state.
Use
- Install the @pongo-ui/react-switch component.
Using NPM
npm install @pongo-ui/react-switch
Using Yarn
yarn add @pongo-ui/react-switch
Install the @pongo-ui/react-provider and our theme tokens from @pongo-ui/react-theme
Set up the provider in your app:
import { Provider } from '@pongo-ui/react-provider'
import { webLightTheme } from '@pongo-ui/react-theme'
const MyApp = () => {
return (
<Provider theme={webLightTheme}>
<Provider>
)
}
- Integrate the Switch component.
import { Provider } from '@pongo-ui/react-provider'
import { webLightTheme } from '@pongo-ui/react-theme'
import { Switch } from '@pongo-ui/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.