Checkbox
ImplementedTri-state checkbox with label. 18×18 box, 2px teal border, solid teal fill with a white check glyph when checked. Indeterminate state supported. Use for selections; use Switch for immediate on/off settings.
patterns/atoms/checkbox.htmlTri-state checkable control. Supports required + error states and an accessible label association. FR-CA: Case à cocher à trois états.
Checkbox
Interactive atom (Family 1 — Tier 1)
Always renders a visible label and an aria-described error message. Use indeterminate when a parent row has partial selection. For binary settings that apply immediately, use Switch instead.
Ce champ est obligatoire
This component supports light and dark mode.
Interactive demo
accepted = false · newsletter = true
Usage
import { Checkbox } from '@epasslive/design-system'
const [accepted, setAccepted] = useState(false)
<Checkbox checked={accepted} onChange={setAccepted} label="J'accepte les conditions" required />Accessibility
- Label is associated with the input via a generated id + htmlFor.
- When
erroris supplied the input getsaria-describedby. - Indeterminate is set via the native
indeterminateproperty, which assistive tech announces asaria-checked="mixed". - Required state renders an asterisk and
aria-required.
Props
checked*boolean | 'indeterminate'Current state.
onChange*(checked: boolean) => voidToggle handler.
label*stringVisible and announced label.
disabledbooleanfalseDisables interaction.
requiredbooleanfalseMarks the field required.
errorstringValidation message announced via aria-describedby.
namestringForm field name.
idstringOverride the auto-generated id.
classNamestringExtra classes appended to the root element.
Props
Checkbox
checkedboolean | 'indeterminate'—Controlled state; 'indeterminate' renders the dash glyph.
onChange(checked: boolean) => void—Fires on user toggle with the plain boolean value.
labelstring—Visible label, associated via htmlFor.
disabledbooleanfalseDisables interaction.
requiredbooleanfalseSets aria-required and renders a visible asterisk.
errorstring—Validation message; sets aria-invalid + aria-describedby.
idstringuseId()Overrides the auto-generated input id.
namestring—Native form field name.
classNamestring—Extra classes appended to the root element.
<Checkbox />Accessibility
Type
1 ruleARIA
1 ruleUsage
Import
import { Checkbox } from "@epasslive/design-system"Example 1
<Checkbox checked={accepted} onChange={setAccepted} label="Accept terms" required />Anti-patterns
— Do not compose atoms directly — use molecules instead
— Avoid inline styles on atoms