Components/Checkbox

Forms component

Checkbox

Square ink box that fills with a saturated color and shows a bold black check on toggle. Backed by a real <input type="checkbox"> — fully keyboard and screen-reader accessible. Controlled or uncontrolled. Optional inline label. 4 fill colors.

FormControlledAccessibleKeyboard4 colorsLabel prop
components/forms/Checkbox.jsx
Interactive — click to toggle
All checkboxes are interactive
Fill colors
color prop — 4 options
States
unchecked · checked · disabled unchecked · disabled checked
Do / Don't
✓ Do

Always use the SLAB Checkbox component. It wraps a real input internally — you get SLAB styling and full keyboard + screen-reader support automatically.

✕ Don't
Hand-rolled div checkbox

Don't build checkboxes from scratch using div or span. They're invisible to keyboards and screen readers.

Props
PropTypeDefaultDescription
checkedbooleanControlled checked state. Omit for uncontrolled.
defaultCheckedbooleanfalseInitial state for uncontrolled usage.
onChange(checked: boolean) => voidCalled with new checked state on toggle.
idstringautoStable id wired to the hidden <input> and <label htmlFor>. Auto-generated if omitted.
labelstringnullInline label text — clicking it also toggles the checkbox.
color"lime"|"pink"|"violet"|"neon""lime"Fill color when checked.
disabledbooleanfalseMutes to 45% opacity, disables pointer events.
styleCSSProperties{}Merged onto the root element.
Usage
import { Checkbox } from "components/forms/Checkbox";

// Uncontrolled with label
<Checkbox label="Enable notifications" />

// Controlled
<Checkbox
  checked={agreed}
  onChange={setAgreed}
  label="I agree to the terms"
  color="violet"
/>

// Disabled
<Checkbox checked disabled label="Locked setting" />