Toggle

Actions

A pressable button that maintains an on/off state. Lighter than Switch, designed for toolbars and filters.

Props

PropTypeDefaultDescription
modelValuebooleanfalsePressed state (v-model).
variant"outline" | "ghost""outline"Visual style.
size"sm" | "md" | "lg""md"Size.
disabledbooleanfalseDisables the toggle.

Examples

Variants
vue
<script setup>
const pressed = ref(false)
</script>
<template>
  <DsToggle v-model="pressed">Bold</DsToggle>
</template>

Skeleton

Use DsToggleSkeleton as a loading placeholder while content is being fetched.

Small
vue
<DsToggleSkeleton size="sm" />
Medium
vue
<DsToggleSkeleton size="md" />
Large
vue
<DsToggleSkeleton size="lg" />

Accessibility

  • role="switch" with aria-pressed state.
  • Keyboard activatable.
  • Focus visible ring.