Checkbox
When to use it
Section titled “When to use it”- To let the user opt in to something, such as marketing emails or staying signed in.
- To confirm the user has read and agreed to terms before they continue, such as the booking terms or cancellation policy.
- To make the user acknowledge a destructive action before it runs, using the error state (for example, “I understand this is permanent”).
- For a list of options where the user can choose any number, such as search filters.
When not to use it
Section titled “When not to use it”- For a setting that takes effect immediately: use the Toggle component instead.
Instead: Toggle - When the user must pick exactly one option from a list: use the Radiocard component instead.
Instead: Radiocard - To trigger an action: use the Button component instead.
Instead: Button
Best practice
Section titled “Best practice”From the Figma documentation page (usage node 118:10), as written. These items aren’t carried into Checkbox.intent.json, which has no field for them.
- Always give the checkbox a visible label that says what ticking it does.
- Write labels as positive statements (“Email me deals”), not negatives (“Don’t email me”).
- Leave opt-in checkboxes unticked by default.
- Make the whole label clickable, not just the 16px box.
- Use the error state only for acknowledging destructive or irreversible actions.
- Put extra detail in helper text below the label, not in the label itself.
What each variant is for
Section titled “What each variant is for”| Property | Value | What it is for |
|---|---|---|
state |
unchecked |
default |
state |
checked |
The tick shows the checked state, so it doesn’t rely on colour alone. |
Accessibility
Section titled “Accessibility”- The control is a native <input type=“checkbox”>, so keyboard, focus and disabled behaviour are the browser’s own.
src/components/Checkbox/Checkbox.tsx:19 - The input and label text sit inside one <label>, so clicking the label text toggles the checkbox and gives it its accessible name.
src/components/Checkbox/Checkbox.tsx:17 - The tick is a decorative SVG hidden from assistive technology (aria-hidden); the checked state is carried by the native input.
src/components/Checkbox/Checkbox.tsx:24
What this version promises
Section titled “What this version promises”From Versioning (VERSIONING.md at b9ffb76):
0.3.0 adds six components on top of 0.2.1: Calendar, Card, Form, Modal, SideBar and Table. It contains twenty-three components, each exported from the package root with its props type: Avatar, Breadcrumbs, Button, ButtonGroup, Calendar, Card, Checkbox, Chip, Dropdown, File, Form, Header, Image, Link, Logo, Modal, ProgressBar, RadioCard, SearchBar, SideBar, Stepper, Table, Toggle. Textfield is exported from the package root as well, with TextfieldProps and TextfieldState, and is public like the others (see decisions.md, 2026-10-07, Textfield). It commits you to their props, prop values and defaults, their hz- class names, the tokens in tokens.css and the three entry points (., ./styles.css, ./tokens.css). Everything in 0.3.0 beyond 0.2.1 is an addition: nothing from 0.2.1 was changed, removed or renamed. A change that breaks any of these on 0.x bumps the version to 0.4.0.
Two things about this release are worth knowing:
- Form, Modal and Table each passed release review with their literal sizes covered by a ruling in decisions.md (Card, SideBar and Calendar have their own), because no size tokens exist for them. Those literals are accepted until the designer adds matching tokens, so a later change to use tokens at the same rendered sizes would be a patch, not a breaking change.
- Dark theme is not verified for Table, and its warning tag has low contrast. The Table docs page says so. Neither is a breaking-change risk, but a fix that changes a token’s value is a patch and is listed in the changelog.
Stories
Section titled “Stories”Unchecked
Section titled “Unchecked”Checked
Section titled “Checked”Unchecked Without Label
Section titled “Unchecked Without Label”Checked Without Label
Section titled “Checked Without Label”All States
Section titled “All States”Import
Section titled “Import”import { Checkbox } from "@layerbasesystemic/horizon-design-system";import type { CheckboxProps } from "@layerbasesystemic/horizon-design-system";@layerbasesystemic/horizon-design-system/tokens.css and @layerbasesystemic/horizon-design-system/styles.css must be loaded too; see Developing.
| Prop | Type | Default | Description |
|---|---|---|---|
label |
string |
"Label" |
— |
showLabel |
boolean |
true |
— |
CheckboxProps also extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" \| "children">, so native attributes pass through to the element (Checkbox.tsx:4).
Tokens it needs
Section titled “Tokens it needs”Every CSS custom property Checkbox.css reads, with its value in the token build at b9ffb76.
| Token | Light | Dark |
|---|---|---|
--border-width-md |
2px |
same as light |
--border-width-sm |
1px |
same as light |
--color-bg-elevated |
#f9fafb |
#4d5361 |
--color-border-strong |
#c8d2dd |
#6a7180 |
--color-interactive-primary |
#3b71f2 |
#6692f8 |
--color-text-inverse |
#f9fafb |
#161925 |
--color-text-secondary |
#4d5361 |
#9ca2b1 |
--fontfamily-body |
Inter |
same as light |
--fontsize-lg |
13px |
same as light |
--lineheight-lg |
20px |
same as light |
--radius-xs |
2px |
same as light |
This matches required_tokens in Checkbox.intent.json exactly.
Figma node
Section titled “Figma node”Page Checkbox (57:1632), documentation frame ❖ checkbox (118:2), component set checkbox (117:23). The file is shared with the team only, so the frame and the link ask anyone outside it to sign in.
Variant matrix
Section titled “Variant matrix”state (2) × ShowLabel (2) = 4 cells. The documentation frame (109:485) lays out state (rows: unchecked, checked) against ShowLabel (columns: True, False). The component set (117:23) publishes two variants, state=unchecked (117:12) and state=checked (117:15). Label (text, default “Label”) and ShowLabel are component properties. The error state is named in the component description but is not drawn.
state |
Figma node | Story |
|---|---|---|
unchecked |
117:12 |
Unchecked |
checked |
117:15 |
Checked |
ShowLabel: True, False. Stories that set showLabel: Unchecked Without Label, Checked Without Label; it defaults to true.
Themes
Section titled “Themes”The Checkbox frame renders every cell in one theme. It has no separate light and dark frames.
The token build defines 179 tokens for light and redeclares 50 for dark; the Code tab shows Checkbox’s tokens in both.
Values Figma never bound
Section titled “Values Figma never bound”Values on the Figma node that aren’t bound to a variable, and what Checkbox.css at b9ffb76 does with each.
| Layer | Property | Figma value | In the code |
|---|---|---|---|
| checkbox, state=unchecked (117:12) and state=checked (117:15) | gap between the box and the label | 10px |
gap: 10px; |
| box (117:13 unchecked, 117:16 checked) | width and height | 16px |
width: 16px; |
Figma variables against the token build
Section titled “Figma variables against the token build”| Figma variable | Figma value | Token in the build | Built light value | Agrees |
|---|---|---|---|---|
--radius-xs |
2 |
--radius-xs |
2px |
yes |
--border-width-sm |
1 |
--border-width-sm |
1px |
yes |
--color-bg-elevated |
#f9fafb |
--color-bg-elevated |
#f9fafb |
yes |
--color-border-strong |
#c8d2dd |
--color-border-strong |
#c8d2dd |
yes |
--color-text-secondary |
#4d5361 |
--color-text-secondary |
#4d5361 |
yes |
--fontSize-lg |
13 |
--fontsize-lg |
13px |
yes |
--fontWeight-regular |
Regular |
no such token | — | no token |
--fontFamily-body |
Inter |
--fontfamily-body |
Inter |
yes |
--lineHeight-lg |
20 |
--lineheight-lg |
20px |
yes |
--color-text-inverse |
#f9fafb |
--color-text-inverse |
#f9fafb |
yes |
--color-primary-default |
#3b71f2 |
--color-primary-default |
#2b5ad6 |
no |
--fontWeight-regular is bound in Figma but the token build has no token of that name.
--color-primary-default holds a different value in Figma from the token of the same name in the build, but Checkbox.css doesn’t read that token, so this doesn’t change how the shipped component renders.
Design gaps recorded against it
Section titled “Design gaps recorded against it”- 2026-10-01 · Checkbox values with no token (decisions.md). These literals in src/components/Checkbox/Checkbox.css are accepted, because they’re what the Figma node specifies, until the designer adds matching tokens. Accepted values:
10px(gap between the box and the label,.hz-checkbox, line 4);16px(width, height on the box,.hz-checkbox__box, lines 11, 12). Not ruled: Any other literal value, including a var() fallback. These values in any other component. A change to these values: a different number needs a new ruling or a token. The Button ruling of 2026-09-28 is separate and still covers only Button.css. The error state and any states Figma does not draw (disabled, hover, focus, indeterminate): those need the designer.