Jump to a component
Core · Forms
Checkbox
Checkbox is one thing chosen or not, among others that may be chosen too: the files to queue, the rows to delete, the terms you agree to. Its box has an edge when off and fills with the accent and a check when on.
Live, from @anicanon/sakuga 2.0.0
Sakuga for iOS and Android is coming
iOS
Coming soon
Checkbox for iOS is in the roughs. The tokens it will read are the ones on this page, the same on every platform.
Android
Coming soon
Checkbox for Android is in the roughs. The tokens it will read are the ones on this page, the same on every platform.
- Use it for
- Choosing any number of things at once, or for one agreement: rows for a bulk action, files to queue, "I agree to the terms".
- Not for
- A setting that takes effect the moment it changesSwitch
- Choosing among options drawn as tilesOptionTiles with
multiple - Choosing one thing among many, with pictures and searchPicker
Guidelines
checkedandonChange: a press callsonChangewith the new value.labelalways names it;showLabelsets the words beside the box, with an optionalhintunder them, and a press on the words flips it too.mixedis for a box that chooses a set when only some of the set is chosen (select all, over a list where 3 of 12 are chosen). It fills with a dash. Pressing it chooses them all; pressing again chooses none.- The box is 20 px (a 16 px mark with 2 px around it) with a 2 px edge in the control border, corner
radius-xs. On, it fills with the accent and the mark ison-accent. The hit area reachessize-target(44) around it. - Turning it on or off eases the fill on
motion-fast; the mark settles in onmotion-settlewhen it changes while you watch. A press sinks the box toscale-press-smonmotion-instant. Under reduced motion the mark just appears. - With sound on, checking or unchecking plays the on or off sound; mixed to on counts as on (README · Sound).
- In a list, use ListRow's
checkedandonCheck: the row carries the box, named "Select" and the row's title. - What the choices do waits for an action: a bar with the count ("3 selected") and the action ("Queue 3 files").
import { useState } from 'react';
import { Checkbox } from '@anicanon/sakuga/ui';
export default function CheckboxExample() {
const [value, setValue] = useState({ a: true, b: false, c: true });
const v = value;
const n = (v.a ? 1 : 0) + (v.b ? 1 : 0) + (v.c ? 1 : 0);
const set = (k) => (x) => {
const o = Object.assign({}, v);
o[k] = x;
setValue(o);
};
const all = (x) => setValue({ a: x, b: x, c: x });
return (
<>
<Checkbox
label="All files"
showLabel
checked={n === 3}
mixed={n > 0 && n < 3}
onChange={all}
/>
<Checkbox
label="rain-on-glass.wav"
showLabel
checked={v.a}
onChange={set('a')}
/>
<Checkbox
label="toast-take-2.mp4"
showLabel
checked={v.b}
onChange={set('b')}
/>
<Checkbox
label="cold-open-boards.pdf"
showLabel
checked={v.c}
onChange={set('c')}
/>
<Checkbox
label="Keep the originals"
hint="Locked while the files are queued"
showLabel
checked
disabled
/>
</>
);
}PropsCheckboxProps
labelrequiredstringcheckedbooleanmixedbooleanshowLabelbooleanhintstringdisabledbooleanonChange(checked: boolean) => voidclassNamestringEach token reads a role, and the role lands on a value in each theme. Change the role and every component that reads it follows.
Space and shape
check-mark-sizeicon-size-smcheck-insetinset-2xscheck-sizecheck-radiusradius-xscheck-edge-widthline-strongcheck-targetsize-targetcheck-active-scalescale-press-smcheck-disabled-opacityopacity-disabledcheckrow-gapgap-mdcheckrow-box-margin-topcheckrow-words-gapgap-2xsType
checkrow-fonttext-captioncheckrow-words-small-fonttext-smallMotion
check-durationmotion-fastcheck-easingease-standardcheck-active-durationmotion-instantcheck-mark-settle-animationmotion-settleChecked automatically with axe-core 4.11.4 against WCAG 2.2 A and AA, on the live preview above, in light and dark, on 26 October 2026.
- Result
- No issues found, in light or in dark.
- By design
- A checkbox named by
labelthat Tab reaches; Enter or Space flips it throughonChange, and it is announced "checked", "not checked" or "mixed".disabledtakes it out of the tab order. WithshowLabelthe row is its label, so a click on the words flips it too, and thehintis its description. The mark is hidden; the state is said. In forced colours the edge and the mark draw in the system colours. - Not tested
- The automated check doesn't test keyboard use, focus order or what a screen reader says. The lines above are the design system's own account of them.