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

Group

A headless component for managing multi-selection with batch operations and tri-state support.

Usage

The Group component is a specialization of Selection that enforces multi-selection behavior and supports batch operations on arrays of IDs. It always uses array-based v-model binding.

Features

Batch Operations

The default slot exposes selectAll, unselectAll, and toggleAll methods for operating on all items at once:

vue
<template>
  <Group.Root v-model="selected">
    <template #default="{ selectAll, unselectAll, toggleAll, isAllSelected, isMixed }">
      <button @click="toggleAll">
        {{ isAllSelected ? 'Deselect All' : 'Select All' }}
      </button>

      <Group.Item v-for="item in items" :key="item" :value="item">
        {{ item }}
      </Group.Item>
    </template>
  </Group.Root>
</template>

Tri-State

The slot props isAllSelected, isNoneSelected, and isMixed reflect the aggregate selection state — useful for driving an “indeterminate” checkbox:

vue
<template>
  <Group.Root v-model="selected">
    <template #default="{ isAllSelected, isMixed, toggleAll }">
      <input
        type="checkbox"
        :checked="isAllSelected"
        :indeterminate="isMixed"
        @change="toggleAll"
      />
    </template>
  </Group.Root>
</template>

Anatomy

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

<template>
  <Group.Root>
    <Group.Item />
  </Group.Root>
</template>

API Reference

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

Group.Root

Props

namespace

string | undefined

Namespace for dependency injection (must match GroupItem namespace)

Default: "v0:group"

disabled

boolean | undefined

Disables the entire group instance

Default: false

enroll

boolean | undefined

Auto-select non-disabled items on registration

Default: false

mandatory

boolean | "force" | undefined

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

Default: false

modelValue

T | T[] | undefined

Events

update:model-value

[value: T | T[]]

Slots

default

GroupRootSlotProps

Group.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

indeterminate

MaybeRefOrGetter<boolean> | undefined

Sets the indeterminate state (for checkboxes)

Default: false

namespace

string | undefined

Namespace for dependency injection

Default: "v0:group"

Slots

default

GroupItemSlotProps<V>
Was this page helpful?

Ctrl+/