Skip to content

Checkbox

SCheckbox is a checkbox built on Reka UI with correct semantics (role="checkbox", keyboard, data-state). The label is rendered with the reusable SLabel. It supports a mixed state (indeterminate) and works with v-model.

Basic usage

Color

The color prop sets the checked state color from the palette (primary, teal, teal-10); text-color sets the check mark color.

Mixed state

State icons

checked-icon sets the checked state icon, indeterminate-icon the mixed state icon (both take a registry name or a raw path).

Required checkbox

The required prop marks the checkbox as required for form submission: the browser will not submit the form until it is checked.

Hint and error message

The hint and error props render text under the checkbox and link it through aria-describedby, with no separate SFormField wrapper needed.

Label from markup

The slot accepts more than text: the label flows like a regular paragraph, so links inside it wrap together with the rest of the sentence, and the required asterisk stays attached to the last word. You do not need to wrap the content in a single element.

Alignment and stretch

align="center" places the box at the middle of a multi-line label; by default it sits at the first line. stretch makes the checkbox fill the container width: the label takes the free space, and a click anywhere on the row toggles the checkbox.

API

Props

NameTypeDefaultDescription
colorstringundefinedAccent color (checked state): a name from the palette (primary/teal/teal-10).
text-colorstringundefinedCheck mark color on the fill: a name from the palette. White by default.
labelstringundefinedLabel text next to the checkbox (can be replaced with the default slot).
valuestringundefinedCheckbox value in a group/form (the value attribute).
disabledbooleanundefinedDisables the checkbox.
requiredbooleanundefinedRequired for form submission.
hintstringundefinedHint below the checkbox.
errorstringundefinedError message below the checkbox. When set, the checkbox is marked invalid.
invalidbooleanundefinedMarks the checkbox invalid explicitly (in addition to error).
checked-iconstring"check"Checked state icon (a registry name or a raw path).
indeterminate-iconstring"minus"Indeterminate state icon (a registry name or a raw path).
align"start" | "center""start"Vertical alignment of the box relative to the label: start aligns it with the first line, center with the middle of a multi-line label.
stretchbooleanundefinedStretches the checkbox to the container width; the label takes the free space. A click anywhere on the row selects the option, which turns the component into a selection card.
idstringundefinedCheckbox id. Generated automatically (SSR-safe) when not set.
model-value | false | true | "indeterminate"falseCheckbox state. 'indeterminate' is the mixed state.

Events

NameSignatureDescription
update:modelValue(value: boolean | "indeterminate") => voidEmitted when modelValue changes. Used for two-way binding (v-model).

Slots

NameDescription
defaultLabel text (alternative to the label prop).