Checkbox
A headless checkbox component with dual-mode support: standalone boolean binding or group multi-selection with tri-state.
Usage
The Checkbox component supports two modes:
- Standalone mode: Use
v-modelonCheckbox.Rootfor simple boolean state - Group mode: Wrap in
Checkbox.Groupfor multi-selection with array v-model
Anatomy
<script setup lang="ts">
import { Checkbox } from '@vuetify/v0'
</script>
<template>
<!-- Standalone -->
<Checkbox.Root>
<Checkbox.Indicator />
</Checkbox.Root>
<!-- Group -->
<Checkbox.Group>
<Checkbox.Root>
<Checkbox.Indicator />
</Checkbox.Root>
<Checkbox.Root>
<Checkbox.Indicator />
</Checkbox.Root>
</Checkbox.Group>
<!-- Group with Select All -->
<Checkbox.Group>
<Checkbox.SelectAll>
<Checkbox.Indicator />
</Checkbox.SelectAll>
<Checkbox.Root>
<Checkbox.Indicator />
</Checkbox.Root>
</Checkbox.Group>
<!-- With form submission -->
<Checkbox.Root>
<Checkbox.Indicator />
<Checkbox.HiddenInput />
</Checkbox.Root>
</template>Group Mode
Wrap checkboxes in Checkbox.Group for multi-selection with array-based v-model:
Selected: none
Accessibility
The Checkbox.Root component renders as a button and handles all ARIA attributes automatically:
role="checkbox"for proper semanticsaria-checkedreflects state (true,false, or"mixed")aria-disabledwhen checkbox is disabledaria-labelfrom thelabelproptabindex="0"for keyboard focus (removed when disabled)- Space key toggles the checkbox (Enter works when rendered as button)
For custom implementations, use renderless mode and bind the attrs slot prop to your element:
<template>
<Checkbox.Root v-slot="{ attrs }" renderless>
<div v-bind="attrs">
<!-- Custom checkbox visual -->
</div>
</Checkbox.Root>
</template>Form Integration
When the name prop is provided on Checkbox.Root, a hidden native checkbox is automatically rendered for form submission:
<template>
<!-- Auto-renders hidden input for form submission -->
<Checkbox.Root name="agree" value="yes">
<Checkbox.Indicator>✓</Checkbox.Indicator>
</Checkbox.Root>
</template>For custom form integration, use Checkbox.HiddenInput explicitly:
<template>
<Checkbox.Root>
<Checkbox.Indicator>✓</Checkbox.Indicator>
<Checkbox.HiddenInput name="custom" value="override" />
</Checkbox.Root>
</template>Indeterminate State
Use Checkbox.SelectAll within a group for “select all” patterns. It automatically reflects the group’s aggregate state and toggles all items on click:
Selected: none
The SelectAll component:
- Binds to the group’s
isAllSelectedandisMixedstate - Calls
toggleAllon click - Does NOT register as a group item
- Sets
aria-checked="mixed"anddata-state="indeterminate"when partially selected
Checkbox.Root
Props
namespace
stringNamespace for context provision to children (Indicator, HiddenInput)
Default: "v0:checkbox:root"
modelValue
booleanEvents
update:model-value
[value: boolean]Slots
default
CheckboxRootSlotProps<V>Checkbox.Group
Props
mandatory
boolean | "force"Controls mandatory checkbox behavior: - false (default): No mandatory enforcement - true: Prevents deselecting the last selected item - `force`: Automatically selects the first non-disabled item on registration
Default: false
modelValue
T | T[]Events
update:model-value
[value: T | T[]]Slots
default
CheckboxGroupSlotPropsCheckbox.HiddenInput
Props
namespace
stringNamespace for context injection from parent Checkbox.Root
Default: "v0:checkbox:root"
Checkbox.Indicator
Props
namespace
stringNamespace for context injection from parent Checkbox.Root
Default: "v0:checkbox:root"
Slots
default
CheckboxIndicatorSlotPropsCheckbox.SelectAll
Props
Slots
default
CheckboxSelectAllSlotProps