1.0.0-rc.9 • Published 3 years ago
@gdo-bzh/switch v1.0.0-rc.9
switch
Switches toggle the state of a single item on or off.
Install
yarn add react reakit @gdo-bzh/switch @gdo-bzh/system @xstyled/styled-components styled-components
# or
npm install react reakit @gdo-bzh/switch @gdo-bzh/system @xstyled/styled-components styled-components -S
Usage
import React from 'react'
import { Checkbox } from 'reakit/Checkbox'
const Example = () => {
const [checked, toggle] = React.useReducer(value => !value, true)
return <Switch id="mySwitcher" checked={checked} onChange={toggle} />
}
Types
type Options = StyledComponentProps<typeof S.Checkbox, DefaultTheme, any, never>
export type Props = Options & {
/**
* functional color
*/
variantColor?: FunctionalColor
/**
* A processing status is an animation on the thumb of the switch.
* Because a switch shows the actual status of something, sometimes there is a delay in its change of state.
* In such cases, a processing status animation can be used.
*/
processing?: boolean
}
License
MIT © gdo-bzh
1.0.0-rc.9
3 years ago
1.0.0-rc.8
4 years ago
1.0.0-rc.7
4 years ago
1.0.0-rc.6
4 years ago
1.0.0-rc.5
4 years ago
1.0.0-rc.4
4 years ago
1.0.0-rc.3
4 years ago
1.0.0-rc.2
4 years ago
1.0.0-rc.1
4 years ago