Components

Checkbox ​

Checkbox is the low-level checkbox control. Use it when you need to compose custom layouts around the checkbox yourself. For the common labeled row pattern, use CheckboxInput.

Basic Usage ​

Use an accessible name when the checkbox is not paired with visible text in the same component.

Checked ​

Use checked state for persisted preferences so the current selection reads clearly at a glance.

Disabled ​

Disable the checkbox when an option is visible for context but currently unavailable. Disabled checkboxes use a muted opacity and disabled cursor.

API ​

Slots ​

NameDescription
(default)Checkbox label text
hintDescriptive hint (or use the hint attribute)

Props ​

NameDescription
ariaLabelType string | null
Default null
checkboxValueType string
Default on
checkedType boolean
Default false
customErrorCustom validation message; also settable via setCustomValidity().
Type string | null
Default null
defaultCheckedType boolean
Default false
disabledDisables the control and excludes it from constraint validation.
Type boolean
Default false
hintDescriptive hint — use the hint slot for HTML content.
Type string
indeterminateType boolean
Default false
invalidType boolean
Default false
isInvalidAlias for invalid.
nameName submitted with form data.
Type string | null
Default null
requiredMarks the control as required for form submission.
Type boolean
Default false
withHintOnly required for SSR when slotting a hint.
Type boolean
Default false

Methods ​

NameDescription
checkValidity()Runs constraint validation without showing the browser UI.
reportValidity()Runs constraint validation and shows the browser UI when invalid.
resetValidity()Clears custom errors and re-syncs validity state.
setCustomValidity(message: string)Sets or clears a custom validation message.

Events ​

NameDescription
onChange—
onInput—
onPkChangeSome facades also expose value sugar via onChange.

Custom States ​

NameDescriptionCSS selector
disabledThe control is disabled.:state(disabled)
invalidThe control currently fails constraint validation.:state(invalid)
optionalThe control is not required.:state(optional)
requiredThe control is required.:state(required)
user-invalidInvalid after the user has interacted with the control.:state(user-invalid)
user-validValid after the user has interacted with the control.:state(user-valid)
validThe control currently passes constraint validation.:state(valid)

CSS Parts ​

NameDescriptionCSS selector
baseRoot label element::part(base)
checked-iconChecked state icon::part(checked-icon)
controlVisual checkbox box::part(control)
hintHint text container::part(hint)
indeterminate-iconIndeterminate state icon::part(indeterminate-icon)
inputNative checkbox input::part(input)
labelLabel text container::part(label)
Edit this page
Last updated: Sep 9, 2026, 7:18 PM