Switch
Unlike checkboxes, switches should deliver immediate results instead of requiring the user to click "Save" to see the results. See Toggle-Switch Guidelines for more information.
Consider using RFUI's
FormField component to wrap it. If not, you'll probably want to use <label> along with Switch.import { Switch } from "rfui-package";Basic
<Switch />Controlled
<Switch checked={checked} onClick={onClick} />Disabled
Set
disabled to either true or false. Defaults to false.<Switch disabled />Props
| Prop | Required | Default | Type and notes |
|---|---|---|---|
...rest | - | - | See the docs for rest parameters. For Switch, you could pass anything you normally would pass to <input type="checkbox" /> because the return value looks something like this: |