Checkbox
Use checkboxes when people can select one or more options. Compare standard and tiled checkbox styles.
Examples
Default
Breakpoints
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxcheckbox-demo.tsx
Tiled
Breakpoints
Mobile
320pxMobile Lg
480pxTablet
640pxDesktop
1024pxcheckbox-tiled-demo.tsx
Component API
Put Input, Control, Label, and optional Description inside Root. Group coordinates multiple checkboxes by value.
Group<div>
Collects selected item values.
| Prop | Type | Default | Description |
|---|---|---|---|
defaultValue | string[] | [] | Initial values used to accumulate onValueChange results. Set defaultChecked on each Input to match these values. |
onValueChange | (values: string[]) => void | — | Receives the selected values. |
Root<label>
Connects Input, Control, Label, and optional Description.
| Prop | Type | Description |
|---|---|---|
value | string | Value used when Root is inside Group. |
onCheckedChange | ({ checked: boolean }) => void | Receives checked-state changes. |
tile | boolean | Uses the tiled visual treatment. |
Input<input>
Native checkbox control; pass native disabled and required props here.
| Attribute | Value | Purpose |
|---|---|---|
data-disabled | Present when disabled | Style the disabled state. |
data-invalid | Present when invalid | Style the error state. |
Control<div>
Shows a check mark when Input is checked.
Label<div>
Put the checkbox text beside Control.
Description<div>
Add optional help text for this choice.