Components/Switch
Since 1.0.0BETA

Switch

Tactile toggles with state feedback

This page was migrated by AI, please review carefully

Migration is complete, but please validate against source code and manual review.

Switch

Tactile toggles with clear state color and movement.
Status: Beta

Basic Usage

EXAMPLE.VUE
<template>
  <TuffSwitch v-model="enabled" />
  <TuffSwitch v-model="enabled" size="small" />
</template>

Demo

Toggle State

Movement and color change together.

Demo will load when visible.
<template>
  <TuffSwitch :model-value="false" />
  <TuffSwitch :model-value="true" />
</template>

States

PropertyTypeDefaultDescription
disabled--Removes focusability and blocks click, Enter, and Space toggles.
sizesmalldefaultlarge-Visual size variant. The default size does not add a size modifier class.

API (Lite)

PropertyTypeDefaultDescription
modelValueChecked state controlled by v-model.
sizesmalldefaultlargeVisual size variant.
disabledDisables focus and prevents pointer or keyboard toggles.

Events

EventParamsDescription
update:modelValue(value: boolean) => voidv-model update emitted after an enabled click, Enter, or Space toggle.
change(value: boolean) => voidEmitted with the next checked state after an enabled toggle.

Design Notes

  • Movement and color should sync.
  • Use smaller size for dense lists, larger for settings.

Composite Patterns

Settings Row

Switch paired with labels.

Demo will load when visible.
<template>
  <TxTag>Notifications</TxTag>
  <TuffSwitch :model-value="true" />
</template>