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

Single

A headless component for managing single-selection with automatic deselection of previous items.

Usage

The Single component is a specialization of Selection that enforces single-selection behavior. When an item is selected, any previously selected item is automatically deselected.

Features

Auto-Enrollment

Set enroll to automatically select the first registered item. Useful when items are rendered dynamically:

vue
<template>
  <!-- First item to register is selected automatically -->
  <Single.Root enroll v-model="selected">
    <Single.Item v-for="opt in options" :key="opt" :value="opt">
      {{ opt }}
    </Single.Item>
  </Single.Root>
</template>

Mandatory Selection

Use mandatory to prevent deselecting the currently selected item. Use mandatory="force" to also auto-select the first item on mount:

vue
<template>
  <!-- User cannot deselect — at least one item must remain selected -->
  <Single.Root mandatory v-model="selected">
    <Single.Item value="a">Option A</Single.Item>
    <Single.Item value="b">Option B</Single.Item>
  </Single.Root>
</template>

Anatomy

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

<template>
  <Single.Root>
    <Single.Item value="option-1" />

    <Single.Item value="option-2" />
  </Single.Root>
</template>

API Reference

The following API details are for all variations of the Single component.

Single.Root

Props

namespace

string | undefined

Namespace for dependency injection (must match SingleItem namespace)

Default: "v0:single"

disabled

boolean | undefined

Disables the entire single instance

Default: false

enroll

boolean | undefined

Auto-select non-disabled items on registration

Default: false

mandatory

boolean | "force" | undefined

Controls mandatory single behavior: - false (default): No mandatory single enforcement - true: Prevents deselecting the last selected item - `force`: Automatically selects the first non-disabled item on registration

Default: false

modelValue

T | T[] | undefined

Slots

default

SingleRootSlotProps

Single.Item

Props

id

string | undefined

Unique identifier (auto-generated if not provided)

label

string | undefined

Optional display label (passed through to slot, not used in registration)

value

V | undefined

Value associated with this item

disabled

MaybeRefOrGetter<boolean> | undefined

Disables this specific item

namespace

string | undefined

Namespace for dependency injection

Default: "v0:single"

Slots

default

SingleItemSlotProps<V>
Was this page helpful?

Ctrl+/