Playground

Selection

Unchecked, checked, indeterminate (mixed / partial selection), and error.

Size

Default (24px box, 16px label) and compact (20px box, 14px label).

Label & supportive text

The box can stand alone, carry a label, add supportive helper text, and mark a required field with an asterisk.

Disabled

Disabled checkboxes use muted fills and content, with a not-allowed cursor.

When to Use

Best for

  • Selecting any number of options from a list (zero, one, or many)
  • Toggling a single setting or agreement (terms, newsletter opt-in)
  • A parent control that reflects a partial selection with the indeterminate state

Consider alternatives when

  • Only one option may be selected from a set — use a radio group
  • Toggling an immediate on/off action — use a switch or toggle
  • Choosing from many options in limited space — use a select or dropdown

Props

PropTypeRequiredDescription
checkedbooleanNoChecked state (controlled). Pair with onChange
defaultCheckedbooleanNoInitial checked state (uncontrolled, default: false)
indeterminatebooleanNoMixed / partial selection — shows a minus glyph (default: false)
errorbooleanNoError state — critical fill, red border, critical helper text (default: false)
compactSizebooleanNo20px box instead of the default 24px (default: false)
labelstringNoLabel text. When omitted, only the box renders
supportiveTextstringNoHelper text under the label
requiredbooleanNoShow a required asterisk after the label (default: false)
isDisabledbooleanNoDisable interaction (default: false)
onChange(checked: boolean) => voidNoChange handler — receives the next checked value
namestringNoForm field name
idstringNoElement id (autogenerated when omitted)

Import

import { Checkbox } from '@/components/Checkbox/eshop';

Wrap the checkbox (or any ancestor) in <div data-platform="eshop"> so the eShop typography classes apply.

Design Tokens

PurposeToken
Box fill (unchecked)var(--color-fill-element-field)
Box border (unchecked)var(--color-border-element-field)
Box fill (checked / indeterminate)var(--color-fill-element-field-selected)
Box fill (error)var(--color-fill-element-critical-soft)
Box border (error)var(--color-border-element-field-error)
Box fill (selected disabled)var(--color-fill-element-bold-disabled)
Glyph (check / minus)var(--color-content-primary-inverse)
Label textvar(--color-content-primary)
Supportive textvar(--color-content-secondary)
Error / required textvar(--color-content-critical)
Disabled contentvar(--color-content-disabled)
Focus ringvar(--color-border-element-focus-ring)
Box radiusvar(--primitive-radius-4)
Typography (label).body-md / .body-sm (scoped to [data-platform="eshop"])

Related Components

Page tokens