Switch
Turns a setting on or off straight away.
import { Switch } from '@rajatweb/argent'
<Switch label="Notifications" defaultChecked onCheckedChange={save} />Props
| Prop | Type | Default | What it does |
|---|---|---|---|
label required | string | ||
checked | boolean | ||
defaultChecked | boolean | ||
disabled | boolean | ||
hint | string | ||
onCheckedChange | (checked: boolean) => void |
Accessibility
- A bar marks "on", so it never depends on colour.
Do
- Apply the change at once.
Don’t
- Make people press Save afterwards.