Includes or excludes one item, saved with a form.
import { Checkbox, Field } from "@usememos/ui";
<Field.Root>
<Field.Label>
<Checkbox checked={digest} onCheckedChange={setDigest} /> Weekly digest
</Field.Label>
</Field.Root>interface CheckboxProps extends BaseCheckbox.Root.Props {
size?: Size; // box: 14, 16, 18px
}Wraps Base UI's Checkbox root with its indicator built in: checked, defaultChecked, onCheckedChange, indeterminate, disabled, name, value pass through. Renders a <span role="checkbox"> and a hidden <input> for forms.
- Name it with a
Field.Labelaround it, oraria-label. - For a setting that applies at once, use Switch. For a labeled group, wrap the boxes in a Fieldset.
- Unchecked: an empty well with an edge. Checked: a flat
primarysquare with a contrasting mark. - Lucide
Checkat a 2px stroke;Minuswhen indeterminate. The mark changes immediately with the state, without a delayed fade or scale animation. The control does not resize while pressed.