Switch
A labelled on/off toggle switch.
Import
import { Switch } from "@tarve/core";Usage
import { Switch } from "@tarve/core";
let airplane = false;
<Switch
label="Airplane mode"
checked={airplane}
onCheckedChange={(checked) => {
airplane = checked;
}}
/>Props
| Prop | Type | Default |
|---|---|---|
checked required | boolean | — |
label required | string | — |
disabled | boolean | — |
onCheckedChange | (checked: boolean) => void | — |
Common props
Shared by every component. See descriptions →
childrenhighlightidkeymotionFromonHighlightonPasteonTransitionEndrovingGroupstyle