Skip to main content
Vuetify0 is now in alpha!
Vuetify0 Logo
Theme
Mode
Palettes
Accessibility
Vuetify One
Sign in to Vuetify One

Access premium tools across the Vuetify ecosystem — Bin, Play, Studio, and more.

Not a subscriber? See what's included

Toggle

A headless toggle button with dual-mode support: standalone boolean binding or group selection with single and multi-select.

Usage

The Toggle component supports two modes:

  • Standalone mode: Use v-model on Toggle.Root for simple boolean on/off state

  • Group mode: Wrap in Toggle.Group for single or multi-select with value-based selection

Anatomy

vue
<script setup lang="ts">
  import { Toggle } from '@vuetify/v0'
</script>

<template>
  <!-- Standalone -->
  <Toggle.Root>
    <Toggle.Indicator />
  </Toggle.Root>

  <!-- Group (single select) -->
  <Toggle.Group>
    <Toggle.Root>
      <Toggle.Indicator />
    </Toggle.Root>

    <Toggle.Root>
      <Toggle.Indicator />
    </Toggle.Root>

    <Toggle.Root>
      <Toggle.Indicator />
    </Toggle.Root>
  </Toggle.Group>

  <!-- Group (multi select) -->
  <Toggle.Group multiple>
    <Toggle.Root>
      <Toggle.Indicator />
    </Toggle.Root>

    <Toggle.Root>
      <Toggle.Indicator />
    </Toggle.Root>

    <Toggle.Root>
      <Toggle.Indicator />
    </Toggle.Root>
  </Toggle.Group>
</template>

Examples

Toolbar

Use Toggle.Group with multiple to build a formatting toolbar. Each toggle operates independently — any combination can be active.

View Switcher

Use Toggle.Group with mandatory for mutually exclusive options like layout switchers. The mandatory prop prevents deselecting all items.

Accessibility

Toggle renders as a native <button> element with proper ARIA attributes:

AttributeValueDescription
aria-pressedtrue / falseReflects the pressed state
aria-disabledtrue / absentPresent when disabled

Group ARIA

AttributeValueDescription
rolegroupIdentifies the toggle group
aria-orientationhorizontal / verticalLayout direction
aria-disabledtrue / absentPresent when group is disabled

Keyboard

KeyAction
SpaceToggle pressed state
EnterToggle pressed state (native button behavior)

Data Attributes

AttributeValuesDescription
data-stateon / offCSS styling hook for pressed state
data-disabledpresent / absentCSS styling hook for disabled state
data-orientationhorizontal / verticalGroup orientation (on group element)

API Reference

The following API details are for all variations of the Toggle component.
Was this page helpful?

Ctrl+/