primitives/@mihcm/ui·v0.21.0·stable
Switch
Controlled on/off toggle. role="switch" with aria-checked driven by checked.
Props
The full prop API for Switch. Same surface in web and React Native — bundlers pick the right variant via the react-native export condition.
| Prop | Type | Default | Description | Since |
|---|---|---|---|---|
checked | boolean | — | Controlled state. Required. | 0.3.0 |
onCheckedChange | (checked: boolean) => void | — | Called on click. Required. | 0.3.0 |
size | 'sm' | 'md' | 'lg' | 'md' | Track height. `md` is 24 px tall. | 0.3.0 |
disabled | boolean | false | Standard disabled state. | 0.3.0 |
Import
import { Switch } from '@mihcm/ui/Switch';