Skip to content

Checkbox ​

A control that allows the user to toggle between checked and not checked.

Usage ​

Approximate web preview — the HarmonyOS rendering is the reference.

Indeterminate ​

A "select all" checkbox driven by its children.

Approximate web preview — the HarmonyOS rendering is the reference.

Sizes, description, card ​

sizing: 'sm' | 'default' | 'lg'; card wraps label and description in a pressable bordered box.

Approximate web preview — the HarmonyOS rendering is the reference.

API ​

Extracted from the @Param / @Event / @BuilderParam declarations in the library sources.

SCheckbox ​

shadcn-vue Checkbox: size-4 rounded-[4px] border border-input shadow-xs, checked bg-primary border-primary text-primary-foreground with a check icon (size-3.5).

Variants: sizing sm | default | lg, description (muted text under the label) and card (a bordered, pressable choice card, highlighted while checked).

indeterminate shows a minus mark (shadcn-vue's 'indeterminate' model value); tapping it emits true, the parent is expected to clear indeterminate. The optional label is part of the tap target. React to changes with onCheckedChange / !! (the control's own tap consumes .onClick() on SCheckbox).

PropTypeDefaultDescription
checked!!boolean | undefinedundefinedControlled state (use with !!). Leave undefined for uncontrolled.
defaultCheckedbooleanfalse
indeterminatebooleanfalse
disabledbooleanfalse
invalidbooleanfalseError look (aria-invalid: destructive border).
labelResourceStr | undefinedundefinedText shown to the right; also tappable.
descriptionResourceStr | undefinedundefinedMuted helper text under the label.
sizingChoiceSize
ChoiceSize = 'sm' | 'default' | 'lg'
'default'
cardbooleanfalseBordered choice card around box, label and description.
tokensCheckboxTokens{}Per-instance token overrides (instance → theme --checkbox-* → recipe), see {@link CheckboxTokens}.
EventTypeDefaultDescription
onCheckedChange(v: boolean) => void() => { }

MIT Licensed