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.
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 |
|---|---|---|---|
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 | - | - |
checkedRequired | - boolean | - |
Events1
| Name | Type | Description |
|---|---|---|
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 --dp(18) | Size of the visible checkbox box. |
--md-checkbox-target-sizeLayoutFallback --dp(40) | 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 --dp(2) | 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. |