Checkbox

Binary input. Supports checked, unchecked, and indeterminate states via modelValue.

Basic

A checkbox paired with a Label so the text is a click target too.

Dark previewReplay previewOpen in new tab

Usage

Import the parts you need from the component's folder.

ts
import { Checkbox } from "@/components/ui/checkbox";

With description

Wrap the label and a FieldDescription in FieldContent for a helper line.

Dark previewReplay previewOpen in new tab

Your Desktop and Documents folders are kept in sync across every device you sign in on.

Disabled

Use the disabled prop to disable the checkbox.

Dark previewReplay previewOpen in new tab

Invalid

Set aria-invalid on the Checkbox and pair it with a FieldError for validation.

Dark previewReplay previewOpen in new tab

Group

Stack several checkboxes in a FieldSet, each bound to its own ref.

Dark previewReplay previewOpen in new tab
Sidebar

Choose which sections appear in the navigation sidebar.

Select all

A header checkbox goes indeterminate when only some rows are selected.

Dark previewReplay previewOpen in new tab
NameRole
Olivia MartinOwner
Jackson LeeMember
Isabella NguyenMember
William KimViewer

API Reference

Checkbox

PropTypeDefaultDescription
modelValueboolean | 'indeterminate'—Checked state. Supports v-model.
defaultValueboolean | 'indeterminate'falseInitial state when v-model is not used.
disabledbooleanfalseDisable input.
idstring—Match with Label for prop.
EventDescription
update:modelValueFires with the new checked state. Enables v-model.

Accessibility

Keyboard shortcuts and ARIA behavior.

Shortcut Description
SpaceToggles the checkbox when focused.
TabMoves focus to or from the checkbox.
  • Uses role=checkbox with aria-checked reflecting the state.
  • Supports an indeterminate (mixed) state via aria-checked="mixed".
  • Pair with a label so the control's purpose is announced.