Skip to content

Checkbox

Free

A box that people check to turn one option on or off in a form. It has checked, mixed, invalid, disabled, and read-only states in 2 sizes.

  • Base UI
  • React 19
  • Tailwind CSS 4

Added Nov 8, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

The value is checked, a boolean. Put the box first inside a Label, so the full row toggles it.

The sample also uses Label. One command adds them with this item:

terms-checkbox.tsx

Checkbox

<span>
PropTypeDefaultDescription
classNamestring—
size"default""lg"—default 16px, or lg 20px. Default: the CheckboxGroup size, else default.
From Base UICheckbox.RootBase UI docs
idstring—The id of the input element.
namestringundefinedIdentifies the field when a form is submitted.
formstring—Identifies the form that owns the hidden input. Useful when the checkbox is rendered outside the form.
...props<span> attributes—Every other attribute goes to the <span>, with a ref.
  • Use it for an option that the form sends when people press Save or Submit.
  • Use a Checkbox Group for options that share one value, a list of names.
  • Use indeterminate for a parent box when only some of its options are checked.
  • For a setting that takes effect at once, use a Switch.
  • To pick one option from a list, use radio buttons.
SpaceChecks or clears the box.

Checkbox is a Base UI Checkbox.Root: a <span> with role="checkbox" and aria-checked (true, false, or mixed when indeterminate), and a hidden native input for the form. It also sets aria-readonly and aria-required.

Name it with a Label, or with FieldLabel in a Field. Base UI reads the label of the hidden input and sets aria-labelledby on the box.

The check and the dash are hidden from screen readers (aria-hidden), because aria-checked says the state. The focus ring shows on keyboard focus only. An invalid box (aria-invalid) shows a red edge and ring.

The box is 16px (lg 20px). On a coarse pointer, hit-area grows the touch target to at least 44 × 44px.

Check
fade · 150ms · ease-out (0, 0, 0.2, 1) · the mark fades in and grows from 60%
Swap check and dash
fade-exit · 90ms out, fade · 150ms in · ease-out (0, 0, 0.2, 1)
  1. AddedCheckbox.
Open the release