Components
Switch
A control that allows the user to toggle between checked and not checked.
Usage
import { Switch } from "@murasakijs/ui";<Switch id="airplane-mode" />API Reference
Props
| Prop | Type | Default |
|---|---|---|
checked | boolean | — |
defaultChecked | boolean | — |
onCheckedChange | (checked: boolean) => void | — |
disabled | boolean | false |
required | boolean | false |
name | string | — |
value | string | "on" |
Switch maps the familiar checked API to React Aria's accessible switch
state and interaction model.