Toggles between checked and not checked, with an indeterminate value for parents of a list.
FreeWeb and MobileMotion
Preview
npx shadcn add @fetaui/checkboxPlayground
Values
Field
Card
Group
1 of 4
Group, invalid
0 of 2
Icons animation
Indeterminate
Invalid
Disabled
Motion
Installation
Terminal· bash
npx shadcn add @fetaui/checkbox
Field
A label and description with the whole row as the target. An error adds a message below.
Invalid
Disabled
Motion
Accessibility
- A native checkbox with a label.
- Indeterminate is set on the input, so it reads as mixed.
- The hit area is 24 px on Web.
Motion
- The box presses to 0.9, fills from the centre and draws its check in one stroke.
- A parent checks its rows 30 ms apart.
- With reduced motion, the state appears at once.
Responsive behavior
- 18 px on Web and 22 px on Mobile, with 44 px rows in a group.
Performance
- The check is one SVG path drawn with pathLength, and the fill scales on a spring.
CheckboxGroupdelays each row by 30 ms throughdrawDelay. With reduced motion there is no delay.
Note for AI
Give your coding assistant the Markdown reference instead of screenshots.
- Import
Checkbox,CheckboxField,CheckboxCardandCheckboxGroupfrom@/components/fetaui/checkbox. - Prefer
CheckboxField. A bareCheckboxneeds anaria-label. - Use
checkedandonCheckedChange, ordefaultChecked.indeterminateis set on the native input. - In
CheckboxGroup, the parent selects only enabled items, and disabled items keep their state. Passitemsand readonValueChange.
Related
SwitchComponentTurns a setting on or off and applies it at once.Radio GroupComponentPick exactly one. A surface circle that fills to an ink disc with a dot.FieldComponentLabel, control and help text as one unit, so they read, validate and announce together.FieldsetComponentFields grouped under a legend, in an inset card on the tray.