Appica UIUI 1.0.0

Checkbox

A box for turning an option on or off.

Usage

Checkbox renders only the box — it has no text of its own. Wrap it and its label in a single <label> so clicking either toggles the box and assistive tech announces them together; no id/htmlFor wiring needed. Use it uncontrolled with defaultChecked, or controlled with checked + onCheckedChange. The animated check and squish are skipped when the user prefers reduced motion.

To manage several related checkboxes as one value, reach for CheckboxGroup.

Examples

States

A checkbox is unchecked, checked, or indeterminate (a mixed state, drawn as a dash). Any of them can also be disabled.

Sizing

Checkbox is sized in em, so it scales with the surrounding font size — set a text-* class on the wrapping <label> and the box and text grow together. It won't shrink below a 16px floor.

With a label and description

Put a title and supporting text beside the box. Keeping both inside the <label> means the whole block is one click target.

Checkbox group

CheckboxGroup shares a single array value across its children, so you read and set the whole set at once instead of tracking each box. Each child is matched to the value array by its name. It lays out vertically by default; pass orientation="horizontal" to wrap into a row.

Select all (parent checkbox)

Give the group the full list of child values via allValues and mark one child parent. When some — but not all — children are checked, the group drives the parent into the indeterminate state automatically; ticking the parent checks every child, and clearing it unchecks them.

RTL

Every Appica UI component supports right-to-left layouts out of the box. Set the dir attribute on a container (commonly your <html> element) so CSS logical properties resolve correctly, and wrap your tree in DirectionProvider so direction-aware behavior — roving focus, popup placement, and the like — follows the same direction.

For setup details and caveats, see the RTL guide.

تفضيلات الإشعارات

API reference

Checkbox and CheckboxGroup wrap Base UI's Checkbox and CheckboxGroup. Each forwards ref, aria-*, and its native attributes; Checkbox exposes data-* state attributes (data-checked, data-unchecked, data-indeterminate, data-disabled, data-readonly, …) for styling and CheckboxGroup renders a <div role="group">. See the Base UI docs for the complete API.

Checkbox

CheckboxGroup

Shares one value array across the checkboxes nested inside it.

Accessibility

  • Renders with role="checkbox". Space toggles it; Tab moves focus to and from it.
  • A checkbox needs an accessible name — wrap it in a <label> together with its text (as shown above), or give it an aria-label.
  • indeterminate is announced as aria-checked="mixed", distinct from checked and unchecked.
  • CheckboxGroup renders a <div role="group">; name it with aria-label or aria-labelledby since a group can't use a wrapping <label>.
  • disabled removes the box from the tab order and exposes data-disabled for styling.
  • The check/squish animations honour prefers-reduced-motion.

© 2026 Appica UI. A free component library, crafted by the Appica team.