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.


Renders elementIntermediateApr 5, 2026

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

Basic Toggle

A standalone bookmark toggle with icon and label driven by v-model.

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.

Formatting Toolbar

Multi-select bold, italic, underline, and strikethrough toggles that apply text formatting.

The quick brown fox jumps over the lazy dog. This sentence demonstrates how your formatting selections apply in real time.

View Switcher

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

View Switcher

Mandatory single-select toggle between grid and list views controlling layout display.

6 folders
Photos
248 items
Documents
53 items
Music
112 items
Videos
37 items
Archives
19 items
Downloads
84 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.

Toggle.Root

Props

id

any

Unique identifier (auto-generated if not provided)

Default: useId()

value

V | undefined

Selection key when inside a Toggle.Group

disabled

boolean | undefined

Disables this toggle

Default: false

namespace

string | undefined

Namespace for context provision to children (Indicator)

Default: "v0:toggle:root"

groupNamespace

string | undefined

Namespace for connecting to parent Toggle.Group

Default: "v0:toggle:group"

modelValue

boolean | undefined

Events

update:model-value

[value: boolean]

Slots

default

ToggleRootSlotProps

Toggle.Group

Props

namespace

string | undefined

Namespace for dependency injection

Default: "v0:toggle:group"

disabled

boolean | undefined

Disables the entire toggle group

Default: false

multiple

boolean | undefined

Allow multiple toggles active at once

Default: false

mandatory

boolean | "force" | undefined

Prevent deselecting the last active toggle

Default: false

orientation

ToggleOrientation | undefined

Layout direction for ARIA

Default: "horizontal"

modelValue

T | T[] | undefined

Events

update:model-value

[value: T | T[]]

Slots

default

ToggleGroupSlotProps

Toggle.Indicator

Props

namespace

string | undefined

Namespace for context injection from parent Toggle.Root

Default: "v0:toggle:root"

Slots

default

ToggleIndicatorSlotProps
Was this page helpful?

© 2016-1970 Vuetify, LLC
Ctrl+/