CheckBox
Checkboxes let people confirm independent selections while preserving clear unchecked, checked, and disabled states. Use presentation when the checkbox is only a visual indicator inside another accessible control, such as a clickable ListItem.
In presentation mode, the control occupies only --md-checkbox-container-size (18dp by default), without an independent hit target. --md-checkbox-target-size applies only to standalone interactive checkboxes (40dp by default). The parent owns spacing and interaction; this works with both ListItem and MenuItem. An explicitly larger container can grow the parent row.
Density
Default geometry follows the body-medium font size. The dimensions below describe default typography; compact and custom typography scale the baseline and its bounds before applying density. Explicit geometry tokens bypass this calculation.
The visible shape starts at 18dp and changes by 1dp per --md-density step, clamped to 14–22dp. Selection marks and default stroke widths scale proportionally. This also applies in presentation mode, where the parent owns spacing and interaction.
Standalone targets start at 40dp and change by 2dp per density step, retaining at least 4dp on each side of the visible shape. The state layer follows the target, shrinking more slowly than menu row spacing to keep hover feedback visible. Explicit shape and target-size tokens override their respective defaults. Icon source calibration and --md-icon-scale do not affect these controls.
Examples
Default
States
Mixed state
checked owns the submitted boolean value; indeterminate owns the mixed visual state and native input.indeterminate property. Use v-model:indeterminate for local state or pass a computed prop for consumer-owned group state. Mixed presentation takes precedence over the checkmark and exposes aria-checked="mixed" on the native input.
User activation follows native checkbox behavior: toggles checked, emits update:checked, then clears indeterminate with update:indeterminate(false). Disabled checkboxes do not update. Presentation mode renders no input and emits no interactions; the parent owns all semantics. The component never derives group selection.
Reference
Anatomy
| Element | Part | Selector |
|---|---|---|
<component> | root | [data-scope="checkbox"][data-part="root"]LMBCopy |
<input> | inputconditional | [data-scope="checkbox"][data-part="input"]LMBCopy |
<span> | control | [data-scope="checkbox"][data-part="control"]LMBCopy |
<span> | box | [data-scope="checkbox"][data-part="box"]LMBCopy |
<span> | icon | [data-scope="checkbox"][data-part="icon"]LMBCopy |
<span> | labelconditional | [data-scope="checkbox"][data-part="label"]LMBCopy |
Props
| Name | Description | Default | Control |
|---|---|---|---|
shapeOptional | Corner style; inherits the shared shape default. M3Shape | undefined | - | - |
disabledOptional | Whether the checkbox is disabled. boolean | undefined | false | |
presentationOptional | Render only the visual checkbox. The parent must provide interaction semantics. boolean | undefined | false | |
nameOptional | Name attribute for the native checkbox input. string | undefined | - | - |
valueOptional | Value attribute for the native checkbox input. string | undefined | - | - |
ariaLabelOptional | ARIA label forwarded to the native checkbox input. string | undefined | - | - |
indeterminateOptional | - boolean | undefined | false | |
checkedRequired | - boolean | - |
Events2
| Name | Type | Description |
|---|---|---|
update:indeterminate | [value: boolean] | - |
update:checked | [value: boolean] | - |
Slots1
| Name | Parameters | Description |
|---|---|---|
default | - | Optional label content rendered next to checkbox. |
Styling25
| Token | Description |
|---|---|
--md-checkbox-colorColorFallback var(--md-sys-color-primary) | Default selected container color and selected state layer color. |
--md-checkbox-on-colorColorFallback var(--md-sys-color-on-primary) | Default selected icon color. |
--md-checkbox-unselected-outline-colorColorFallback var(--md-sys-color-on-surface-variant) | Outline color for the unchecked box. |
--md-checkbox-selected-container-colorColorFallback var(--md-checkbox-color) | Container color for the checked box. |
--md-checkbox-selected-icon-colorColorFallback var(--md-checkbox-on-color) | Checkmark color for the checked box. |
--md-checkbox-unselected-state-layer-colorStateFallback var(--md-sys-color-on-surface) | State layer color when unchecked. |
--md-checkbox-state-layer-colorStateFallback var(--md-checkbox-color) | Shortcut for the checked state layer color. |
--md-checkbox-selected-state-layer-colorStateFallback var(--md-checkbox-state-layer-color) | State layer color when checked. |
--md-checkbox-disabled-colorDisabledFallback var(--md-sys-color-on-surface) | Base color used by disabled checkbox visuals. |
--md-checkbox-disabled-opacityDisabledFallback 0.38 | Default opacity for disabled checkbox visuals. |
--md-checkbox-disabled-unselected-outline-colorDisabledFallback var(--md-checkbox-disabled-color) | Outline color for disabled unchecked state. |
--md-checkbox-disabled-unselected-outline-opacityDisabledFallback var(--md-checkbox-disabled-opacity) | Outline opacity for disabled unchecked state. |
--md-checkbox-disabled-selected-container-colorDisabledFallback var(--md-checkbox-disabled-color) | Container color for disabled checked state. |
--md-checkbox-disabled-selected-container-opacityDisabledFallback var(--md-checkbox-disabled-opacity) | Container opacity for disabled checked state. |
--md-checkbox-disabled-selected-icon-colorDisabledFallback var(--md-sys-color-surface) | Checkmark color for disabled checked state. |
--md-checkbox-disabled-selected-icon-opacityDisabledFallback var(--md-checkbox-disabled-opacity) | Checkmark opacity for disabled checked state. |
--md-checkbox-label-colorLabelFallback var(--md-sys-color-on-surface) | Color of the optional label slot. |
--md-checkbox-container-sizeLayoutFallback Typography and density (18dp at default typography and density 0) | Size of the visible checkbox box. |
--md-checkbox-target-sizeLayoutFallback 40dp + 2dp per density step; at least box size + 8dp; presentation uses box size | Size of the interactive control and state layer area. |
--md-checkbox-state-layer-shapeShapeFallback var(--md-sys-shape-corner-full) | Shape of the state layer area. |
--md-checkbox-shapeShapeFallback --dp(2) | Corner radius of the visible checkbox box. |
--md-checkbox-outline-widthLayoutFallback Resolved box size / 9 | Outline width of the unchecked box. |
--md-checkbox-focus-indicator-colorFocusFallback var(--md-sys-color-secondary) | Focus ring color. |
--md-checkbox-focus-indicator-thicknessFocusFallback var(--md-sys-state-focus-indicator-thickness) | Focus ring thickness. |
--md-checkbox-focus-indicator-offsetFocusFallback var(--md-sys-state-focus-indicator-outer-offset) | Focus ring offset. |