Checkbox
A checkbox for boolean state or multi-selection groups with tri-state support.
Usage
Basic Checkbox
A standalone checkbox with checkmark indicator and label.
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>Examples
Checkbox Group
Multi-select checkbox group with three fruit options showing the selected state.
Selected: none
Select All Pattern
A “select all” checkbox with tri-state behavior (checked, unchecked, indeterminate) over nested items.
Selected: none
The SelectAll component:
Binds to the group’s
isAllSelectedandisMixedstateCalls
toggleAllon clickDoes NOT register as a group item
Sets
aria-checked="mixed"anddata-state="indeterminate"when partially selected
Recipes
Form Integration
Pass the name prop on Checkbox.Root and a hidden native checkbox is rendered automatically. No Checkbox.HiddenInput placement is required:
<template>
<Checkbox.Root name="agree" value="yes">
<Checkbox.Indicator>✓</Checkbox.Indicator>
</Checkbox.Root>
</template>Checkbox.HiddenInput is exported as an internal building block for custom layouts, but auto-rendering via name is the only supported form integration path — placing Checkbox.HiddenInput as a child of a Checkbox.Root that already has a name will produce two hidden inputs.
Styling with Data Attributes
Checkbox.Root exposes data attributes for CSS styling without conditional classes:
| Attribute | Values | Notes |
|---|---|---|
data-state | checked, unchecked, indeterminate | Reflects current visual state |
data-disabled | true | Present only when disabled |
<template>
<Checkbox.Root class="size-5 rounded border data-[state=checked]:bg-primary data-[disabled]:opacity-50">
<Checkbox.Indicator>✓</Checkbox.Indicator>
</Checkbox.Root>
</template>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>Pass the disabled prop on Checkbox.Root. The component sets aria-disabled, removes tabindex, ignores click and Space key events, and exposes data-disabled="true" for styling.
Checkbox.Root only renders the hidden native input when a name prop is set. Without name, the checkbox is purely visual and won’t appear in FormData. Add name="myField" (and optionally value) to participate in form submission.
Checkbox.Group is a multi-selection container — its v-model is an array of selected values, individual checkboxes support an indeterminate prop, and Checkbox.SelectAll reflects the group’s aggregate mixed state. A radio group is single-selection — exactly one option is active and v-model holds a single value.
Yes. Checkbox.Indicator is purely cosmetic — it reads checkbox state from context to render a checkmark. You can omit it entirely and render your own visual using the attrs slot prop on Checkbox.Root, or use renderless mode for full control over the rendered element.
Checkbox.Root
Props
namespace
string | undefinedNamespace for context provision to children (Indicator, HiddenInput)
Default: "v0:checkbox:root"
groupNamespace
string | undefinedNamespace for connecting to parent Checkbox.Group
Default: "v0:checkbox:group"
modelValue
boolean | undefinedEvents
update:model-value
[value: boolean]Slots
default
CheckboxRootSlotProps<V>Checkbox.Group
Props
mandatory
boolean | "force" | undefinedControls 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[] | undefinedEvents
update:model-value
[value: T | T[]]Slots
default
CheckboxGroupSlotPropsCheckbox.HiddenInput
Props
namespace
string | undefinedNamespace for context injection from parent Checkbox.Root
Default: "v0:checkbox:root"
Checkbox.Indicator
Props
namespace
string | undefinedNamespace for context injection from parent Checkbox.Root
Default: "v0:checkbox:root"
Slots
default
CheckboxIndicatorSlotPropsCheckbox.SelectAll
Props
namespace
string | undefinedNamespace for context provision to children (Indicator)
Default: "v0:checkbox:root"
groupNamespace
string | undefinedNamespace for connecting to parent Checkbox.Group
Default: "v0:checkbox:group"
Slots
default
CheckboxSelectAllSlotProps