<XrToggle>
An on/off switch with a label. The whole row is the target, at least interaction.minTarget tall.
Usage
vue
<XrToggle v-model="sound">Sound</XrToggle>API
Props
| Prop | Type | Default | Description |
|---|---|---|---|
ui | Record<string, unknown> | {} | Escape hatch: raw uikit (@pmndrs/uikit) properties, merged last. |
disabled | boolean | Greys it out; it does not react to any input. | |
parts | Partial<Record<"label" | "track" | "thumb", Record<string, unknown>>> | Raw uikit properties per inner part, merged after the defaults: track, thumb, label. | |
modelValue | boolean | On or off (v-model). | |
label | string | Text next to the switch. The default slot replaces it. |
Events
| Event | Payload | Description |
|---|---|---|
change | value: boolean, event: ControlPointerEvent | Pressed: the new state and the pointer event. |
update:modelValue | value: boolean | The new state after a press (v-model). |