Components
Checkbox
Checkbox in two sizes with a built-in check mark and an indeterminate dash for partial selections.
import { Checkbox, Field } from "@openperf/deft";
<Field.Root>
<Field.Label>
<Checkbox.Root defaultChecked name="digest" />
Send a weekly digest
</Field.Label>
</Field.Root>;When to use
| Need | Component |
|---|---|
| Pick any number of items from a list | Checkbox |
| Select table rows | Built into Table.SelectCell in Table and selection in Data table |
| Setting that takes effect the moment it flips | Switch |
| Checkable item inside a popup | Menu.CheckboxItem in Menu, or Combobox items with indicator="checkbox" |
Label and state
The checkbox has no label of its own: put it inside a Field.Label from Field before the text, or set aria-label when there is no visible text. disabled on the checkbox or on the Field.Root around it dims it and blocks clicks.
Sizes
| Size | Box | Mark |
|---|---|---|
md | 16px | 12px |
sm | 14px | 10px |
Indeterminate
indeterminate shows a dash instead of a check mark. Set it on a parent checkbox while only some of its items are selected, as the "select all" checkbox of Data table does.
API
Prop
Type