npm.io
0.0.11 • Published 4 years ago

@pongo-ui/react-switch

Licence
MIT
Version
0.0.11
Deps
3
Size
181 kB
Vulns
0
Weekly
0
Stars
4

Switch

The Switch allows users to toggle a value between an on and off state.

Use

  1. Install the @pongo-ui/react-switch component.

Using NPM

npm install @pongo-ui/react-switch

Using Yarn

yarn add @pongo-ui/react-switch
  1. Install the @pongo-ui/react-provider and our theme tokens from @pongo-ui/react-theme

  2. 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>
  )
}
  1. 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.