Switch
import Switch from "@shpaw415/mui-lite/Switch";Why use it
Switch toggles a boolean setting immediately (notifications on/off). Prefer Checkbox for multi-select lists; Switch for binary preferences.
Demo
Enabled
Off
Secondary
Disabled
Example
import Switch from "@shpaw415/mui-lite/Switch";
<Switch defaultChecked label="Dark mode" onChange={onToggle} />Props
| Prop | Type | Default |
|---|---|---|
| label | string | — |
| color | palette | — |
| size | small | — |
| checked / defaultChecked | boolean | — |