Skip to content

Forms

Checkbox

A single yes/no choice, e.g. consent or an option that can be switched on.

  • Experimental
  • Keyboard tested
  • Screen reader not tested yet

Updated 2026-11-12

Playground

Change the props. The controls come from the documented props.
tsx
<Checkbox label="Send me a copy of the request." name="playground-consent" />

States

Every variant in every state, side by side. Hover, pressed and focus are shown statically; the default state is interactive.
  • default
  • checked
  • focus-visible
  • disabled
  • Error: Confirm “Option” to continue.

    invalid

Usage

When to use

Use a checkbox for one yes/no decision that the person makes independently: consent, an opt-in, a setting that is either on or off.

When not to use

  • One answer out of several exclusive options: use RadioGroup.
  • A setting that takes effect immediately, without a submit: that is a switch, which the system doesn't have yet. Report the gap.

How it works

A native checkbox with a 24px box, the WCAG 2.2 minimum target. The label is clickable. Checked fills the box with ink and shows a cream check mark. With required, Form reports an unchecked box like any other invalid field.

Content guidelines

Write the label as the statement that becomes true when the box is checked: “Send me a copy”, not “Copy”. Use the hint for consequences the label can't carry, such as where the copy goes.

Do and don’t

Do
  • Write the label as the statement that becomes true when checked.
Don’t
  • Don't use a checkbox for one of several exclusive options; use RadioGroup.

Anatomy

The parts of the component and what each one does, as in the playground above.
  1. input-field24px box, border.control; checked fills with ink.
  2. indicatorCheck mark in cream, only when checked.
  3. labelBody text next to the box.

Examples

Type-checked, and the same code goes into the AI manifest. Import: import { Checkbox } from "@/ds";

With hint

The copy goes to the email address above.

Props

Checked against the component's TypeScript type on every build.
Checkbox props
NameTypeDefaultDescription
label (required)string–Visible label; clicking it toggles the box.
hintstring–Help text under the label.
errorstring–Error message; overrides native validation.
messagesValidationMessages–Texts for native validation, e.g. required consent.
…inputInputHTMLAttributes–Native attributes such as name, required, defaultChecked.

Tokens used

Derived from the utility classes in the component's source. Copy a class with one click.
Tokens used by Checkbox
TokenTierValueUtility
choice.bordercomponent#8A8578
choice.checkedcomponent#0A0A0B
choice.markcomponent#FAFAF7
choice.radiuscomponent4px
choice.sizecomponent24px
input.bgcomponent#FAFAF7
input.errorRingcomponent#C6492E
focussemantic#C6492E
spacing.1semantic4px
spacing.3semantic12px
state.disabledsemantic0.5
surface.pagesemantic#FAFAF7
text.primarysemantic#0A0A0B
text.secondarysemantic#555555
type.body.sizesemantic16px
type.small.sizesemantic14px

Accessibility

What is checked automatically on every build, and what a person has tested. Nothing is marked as tested unless it was.
Testing status by check
CheckHowStatus
axe-core rulesAutomated on every npm run check, at desktop and mobile widthRuns on every build
KeyboardAutomated Playwright test (scripts/keyboard.mjs)Tested
Screen readerManualNot tested yet

Keyboard

Checkbox keyboard interactions
KeyAction
TabMoves focus to the box.
SpaceChecks or unchecks it.

Semantics and focus

  • Native checkbox: Space toggles it, screen readers announce checked state.
  • 24px target, the WCAG 2.2 minimum.

Contrast

Checkbox contrast pairings
PairingRatio (x:1)MinimumStatus
text.primary on surface.page18.924.5Pass
text.secondary on surface.page7.134.5Pass
accent.default on surface.page4.574.5Pass
text.onInverse on surface.inverse18.924.5Pass
border.control on surface.page3.523.0Pass
focus on surface.page4.573.0Pass
surface.inverse on text.onInverse18.924.5Pass
border.control on surface.inverse5.383.0Pass
accent.default on surface.inverse4.143.0Pass
surface.inverse on accent.default4.143.0Pass