Skip to content

<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 ​

PropTypeDefaultDescription
uiRecord<string, unknown>{}Escape hatch: raw uikit (@pmndrs/uikit) properties, merged last.
disabledbooleanGreys it out; it does not react to any input.
partsPartial<Record<"label" | "track" | "thumb", Record<string, unknown>>>Raw uikit properties per inner part, merged after the defaults: track, thumb, label.
modelValuebooleanOn or off (v-model).
labelstringText next to the switch. The default slot replaces it.

Events ​

EventPayloadDescription
changevalue: boolean, event: ControlPointerEventPressed: the new state and the pointer event.
update:modelValuevalue: booleanThe new state after a press (v-model).

MIT License