Skip to content
Storybook

Checkbox

For independent options and multi-select. Indeterminate shows a partly selected parent.

Preview

React · live from the Storybook

HTML and CSS

The same component as plain HTML with pixels-ui.css, no framework needed.

Notifications

Usage

  • The whole row is the click target.
  • Use a Switch for settings that apply at once.

Installation

Included in the core files. No extra install.

HTML
<link rel="stylesheet" href="/css/pixels-tokens.css">
<link rel="stylesheet" href="/css/pixels-ui.css">
<script src="/js/pixels-ui.js" defer></script>

Examples

States

Default, checked, indeterminate, disabled and error.

Small

px-check--sm (16px box).

API reference

Class / attributeTypeDescription
px-checkclassLabel wrapper (row).
px-check__boxclassPut on <input type="checkbox">.
px-check__hintclassHint under the label.
px-check--smclassSmall size.
aria-invalid="true"attributeError state.
data-px-indeterminateattributeSets indeterminate on load.

Figma properties

Checkbox72 variants · page “Checkbox & Radio Buttons”Open

Checkbox with label and optional hint. Use for independent options and multi-select; Indeterminate shows a partially selected parent. Click target is the whole row. RTL variants place the control on t…

PropertyTypeValues
LabelText“Remember me”
HintText“Save my login details for next time.”
Show hintBoolean—
SizeVariantSmall Medium
CheckedVariantFalse True Indeterminate
StateVariantActive Hover Pressed Focused Disabled Error
DirectionVariantLTR RTL
Checkbox / Control36 variants · page “Checkbox & Radio Buttons”Open

The bare checkbox box. Use inside Checkbox, tables and list items. Tokens: --px-selection-*, --px-checkbox-*.

PropertyTypeValues
SizeVariantSmall Medium
CheckedVariantFalse True Indeterminate
StateVariantActive Hover Pressed Focused Disabled Error

Design tokens

Component tokens from the Figma Component collection. Override them to restyle just this component.

TokenAliasLight value
--px-selection-gapspacing-sm8px
--px-checkbox-size-smspacing-1616px
--px-checkbox-size-mdspacing-2020px
--px-checkbox-radiusradius-44px

Accessibility

  • Group related boxes in a <fieldset> with a <legend>.
  • Space toggles.