0.0.3 • Published 2 years ago

@cebus/react-switch v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Switch

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

Use

  1. Install the @cebus/react-switch component.

Using NPM

npm install @cebus/react-switch

Using Yarn

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

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