Skip to content
Alea0.1

Forms

Checkbox

Yes or no, or several choices from a list. Indeterminate for "some".

Ant Design: Checkbox

import { Checkbox, CheckboxGroup } from '@alea/ui';

Examples

Checkbox

Checked, unchecked, indeterminate, with help text.

Checkbox group

Several choices with one label. Value is the list of checked values.

Run these checks

Selected: contrast

Select all

The indeterminate state for a parent checkbox.

Cards

Several picks as tiles, for add-ons or features.

Add-ons

Props

Checkbox props

A checkbox with checked, indeterminate, invalid and disabled states.

PropTypeDefaultDescription
childrenReactNode-The label next to the box.
descriptionReactNode-Help text under the label.

CheckboxGroup props

A labeled set of checkboxes; value is the list of checked values.

PropTypeDefaultDescription
appearance"default" | "cards"'default'default (a list) or cards (bordered tiles, for plans or features).
descriptionReactNode-Help text under the group.
errorMessageReactNode | ((v: ValidationResult) => ReactNode)-Error text, shown when the group is invalid.
labelReactNode-The visible label for the group.
orientation"horizontal" | "vertical"'vertical'vertical (default) or horizontal.

Accessibility

  • A real checkbox input, so it works with forms and every assistive technology.
  • CheckboxGroup is a labelled group.

Keyboard

KeyDoes
SpaceToggles the checkbox

Do and don't

Do

  • Write labels as positive statements: Send me updates.

Don't

  • Don't use a checkbox for a setting that applies right away: use Switch.

In Figma

Checkbox with State (Unchecked, Checked, Indeterminate) × Interaction × Invalid.

Tested with axe, keyboard and screen reader roles