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.
Anatomy
<script setup lang="ts">
import { Group } from '@vuetify/v0'
</script>
<template>
<Group.Root>
<Group.Item />
</Group.Root>
</template>Recipes
Batch Operations
The default slot exposes selectAll, unselectAll, and toggleAll methods for operating on all items at once:
<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:
<template>
<Group.Root v-model="selected">
<template #default="{ isAllSelected, isMixed, toggleAll }">
<input
type="checkbox"
:checked="isAllSelected"
:indeterminate="isMixed"
@change="toggleAll"
/>
</template>
</Group.Root>
</template>Accessibility
Group is a headless state provider, not a complete checkbox widget. Item attrs include role="checkbox", a tabindex, Space, and the click handler.
Group.Rootexposesaria-multiselectable="true".Group.Itemexposesrole="checkbox",aria-checked(true,false, or"mixed"for the indeterminate state), andaria-disabled, plusdata-selected,data-disabled, anddata-mixedfor styling.
Binding attrs already applies role="checkbox" and Space. For a native hidden input and label association, use Checkbox, which composes the same group logic.
FAQ
Group is a specialization of Selection that always binds an array and enforces multi-selection, adding batch operations (selectAll, unselectAll, toggleAll) and tri-state aggregate state. Reach for Selection when you want the general wrapper; reach for Group for a checkbox group with select-all.
Bind isAllSelected to the checkbox’s checked and isMixed to its indeterminate, then call toggleAll on change — all three are exposed on the default slot.
No — Group always uses array-based v-model. For single-choice state use Single instead.