Components/Form

Checkbox

Checkboxes let a reader choose any number of options from a list, including none of them. Each box answers its own question independently, so ticking one says nothing about the rest. A single box on its own is also how a yes-or-no answer is collected when it travels with a form.

import { Checkbox } from '@growth-protocol-ai/alpha';

On this page

icon
state
Checkbox.tsxtsx
1import { Checkbox } from '@growth-protocol-ai/alpha';
2
3<Checkbox
4 icon="check"
5 indeterminate={false}
6 disabled={false}
7 loading={false}
8 label="Email me about product updates"
9/>

When to use

Reach for a checkbox when each option stands on its own and the reader may tick as many of them as they like, or none at all — a list of interests, a set of filters, one term to agree to. Give every box text it can be clicked on: an unlabelled box leaves the reader guessing what ticking it commits them to, and leaves a screen reader with nothing to read out but the word checkbox.

When not to use

Do not use checkboxes where exactly one answer is allowed. A radio group makes that rule visible before the reader tries to break it, where a row of boxes invites a second tick and then has to take it back. A toggle is the other neighbour, and what separates them is when the answer lands: a toggle switches something on the moment it is pressed, while a checkbox records an answer that the form around it submits later.

icon2 values

Which mark a filled box draws, and so what ticking it means. The box, the fill and the geometry are the same either way — only the drawing inside changes, and only once there is something to draw, which is why both specimens below are ticked.

check
add
iconWhen to use
checkThe ordinary tick. A value is on, a row is selected, a term is agreed.
addA plus, for a box that puts the item into a collection rather than recording an answer about it. Reach for it in a picker, not in a form.