Switch
Install
yarn add @ntds/switchImport
import { Switch } from '@ntds/switch';Props
| Prop | Type | Default | Description |
|---|---|---|---|
setValue? | (value: boolean) => void | — | Pass your setter from useState() directly here. (An alternative to pass onChange handler) |
passive? | boolean | — | This prop is used to remove focus ring and hover effect when component is used as a subcomponent outside a list |
twBackgroundColorOn? | string | bg-haiti-700 dark:bg-blue-400 | Optional background color property, to override background color for 'On' state. |
twBackgroundColorOff? | string | bg-haiti-300 dark:bg-gray-600 dark:text-white | Optional background color property, to override background color for 'Off' state. |
twBallColor? | string | bg-white | Optional color property, to override 'ball' color (the circle). |