Checkbox
A checkbox allows users to select one or more options from a set.
Ready to use
The Checkbox lets a user select one or more options from a list. Unlike radio buttons, checkboxes are non-exclusive — every option toggles independently. Reach for one when more than one selection is valid, when the selection doesn’t trigger an immediate action, or when the user needs to confirm or accept conditions before moving on.
This component is fully responsive and intentionally designed across mobile, tablet, and desktop — no alternative versions required.
Anatomy
Section titled “Anatomy”- Checkbox
- Label
When to use it
Section titled “When to use it”Use a Checkbox when:
- The user can select 0, 1, or multiple options.
- The options aren’t mutually exclusive.
- You’re collecting preferences, filters, settings, or “I agree to…” confirmations.
Avoid a Checkbox when:
- Only one option in the set can be selected — that’s a Radio button.
- The action is binary and takes effect immediately — that’s a Switch (toggle).
Properties
Section titled “Properties”Box
The toggleable square itself. Carries the visible state — Default, Hover, Selected, Disabled, Disabled+Selected, Focus — each driven by its own design-token set. The Focus ring is the global focus token so it stays consistent across every form control.
Check mark
Renders inside the box in Selected and Disabled+Selected states. Decorative — the checked state is conveyed semantically via the native <input type="checkbox">.
Label
The clickable text paired to the input via for/id (or by wrapping the input in the <label>). Always visible; never hide the label or replace it with an icon-only control.
Size
Two sizes — Small and Large. Large is the default for forms and settings; Small is reserved for dense layouts (data tables, filter chips). The hit area stays ≥ 44×44 px in both sizes — the label’s clickable region extends the hit zone past the box itself.
Platform considerations
Section titled “Platform considerations”Desktop
Default Large size. Inside forms, align checkboxes with field labels on the leading edge. For lists, leave at least 8 px between checkbox and label for comfortable scanning at desktop reading distance.
Tablet
Same rules as desktop. Touch-input mode kicks in occasionally — make sure the label’s clickable area extends to the full row so a tap anywhere on the line toggles the box.
Mobile
Default Large size, full-row tap target. Stack vertically; never put checkboxes side-by-side at narrow widths. Keep helper / error text close to the box so the relationship is obvious without spatial cues.
Best practices
Section titled “Best practices”A checkbox is the user’s most low-stakes commitment. Make the option clear, and make undoing the choice just as easy as making it.
Do
Use a native <input type="checkbox"> (never recreate with <div> or <span>). Always wire a visible <label> with for/id. Make Selected, Unselected, and Disabled states visually distinct beyond colour alone. Show a focus ring on keyboard focus — the global focus token, not a checkbox-specific one.
Don't
Don’t use a checkbox when only one option can be selected (that’s a radio). Don’t use one when the toggle applies immediately (that’s a switch). Don’t rely on colour alone to signal state. Don’t suppress the focus outline unless replacing it with something equally accessible.
Content guidelines
Section titled “Content guidelines”Label each checkbox in the affirmative — “Send me product updates” not “Don’t send me product updates”. Lead with the most relevant word so the option is scannable when the form is long. Use sentence case (“Save my address”) rather than title case. For confirmation checkboxes (“I agree to…”), keep the linked policy or terms inline so the user knows what they’re agreeing to without leaving the screen.
Styles
Section titled “Styles”A checkbox allows users to select one or more options from a set.
<label class="tng-checkbox-control"> <input type="checkbox" /> <span>Unchecked</span></label><label class="tng-checkbox-control"> <input type="checkbox" checked /> <span>Checked</span></label>Elements
Section titled “Elements”Grouping
Section titled “Grouping”Group related checkboxes in a <fieldset> with a <legend> to provide a shared group label for screen readers.
<fieldset class="tng-stack"> <legend class="tng-text-title is-8 mb-xl"> Notification preferences </legend> <label class="tng-checkbox-control"> <input type="checkbox" /> <span>Email</span> </label> <label class="tng-checkbox-control"> <input type="checkbox" /> <span>SMS</span> </label></fieldset>States
Section titled “States”Disabled
Section titled “Disabled”<label class="tng-checkbox-control"> <input type="checkbox" disabled /> <span>Disabled</span></label><label class="tng-checkbox-control"> <input type="checkbox" checked disabled /> <span>Checked and disabled</span></label>The checkbox follows the WAI-ARIA Checkbox pattern — a control that toggles independently between checked and unchecked (and, when needed, a third mixed state) — and meets WCAG 2.1 AA. Built on a native <input type="checkbox">, an accessible checkbox is reachable and operable from the keyboard, carries a label that names the option it toggles, and reports its checked state to assistive technology — so the choice is clear whether the user is looking at it, listening to it, or tabbing through it.
For designers
Section titled “For designers”- All states (default, hover, selected, disabled, focus) must maintain accessible contrast on every supported surface. Source: WCAG 1.4.3 Contrast (Minimum).
- The checked state must never rely on colour alone — pair it with the check mark, so it survives for colour-blind users. Source: WCAG 1.4.1 Use of Color.
- Focus styles must stay visible, meet contrast requirements on every supported surface, and be clearly distinguishable from hover. Source: WCAG 2.4.7 Focus Visible.
- Use semantic colour tokens (e.g.
foreground/neutral/default) rather than fixed values, so the component adapts correctly across themes and surfaces.
For developers
Section titled “For developers”Build on a native <input type="checkbox"> and never recreate the control from <div> or <span> — the native element brings the role, state, and keyboard operability that assistive technology relies on. Visible focus is handled by the tng-focus-within utility. When checkboxes are presented in a list, keep sufficient spacing between them to avoid accidental activation. Each box is its own tab stop — unlike a radio group, checkboxes share no roving tabindex, so every box in a group is individually reachable. The per-element roles, names, and states are in the Labelling elements section below.
Keyboard interaction
Section titled “Keyboard interaction”| Key | Action |
|---|---|
| Tab / Shift + Tab | Move focus to the next / previous checkbox |
| Space | Toggle the focused checkbox between checked and unchecked |
Interactive targets — the box plus its label — must be at least 44 px high for comfortable touch use, comfortably clearing the WCAG AA minimum. Source: WCAG 2.5.8 Target Size (Minimum).
Labelling elements
Section titled “Labelling elements”Give every element the role, name, and state assistive technology needs.
Checkbox
A native <input type="checkbox"> exposes the checkbox role and its checked / unchecked state automatically. Set the third state with the indeterminate JavaScript property — announced as “mixed” — and convey a non-interactive box with the native disabled attribute. Don’t move state to aria-* when the native attribute already carries it.
Label
The checkbox takes its accessible name from the associated <label>, wired with for/id or by wrapping the input. Keep the label visible and self-describing — never leave the name to a title or placeholder, and never replace it with an icon-only control.
Group
<legend> names the <fieldset>, so screen readers announce the shared group label before each option (“Notification preferences, Email, checkbox, not checked”). Use it whenever related checkboxes belong to one question.
Supporting text
Connect helper or error text to the input with aria-describedby so it’s announced after the label. Keep error copy programmatic, not colour-only, so the failure is conveyed to assistive technology too.
Source: WCAG 4.1.2 Name, Role, Value.