Skip to main content

Checkbox

A toggle control that allows users to select one or more options.

Basic Usage

Variants

Indeterminate

Disabled

Props

PropTypeDefaultDescription
checkedboolean-Whether the checkbox is checked (controlled)
defaultCheckedboolean-Initial checked state (uncontrolled)
indeterminatebooleanfalseWhether the checkbox shows an indeterminate state
onChange(e: ChangeEvent) => void-Change handler
variant'primary' | 'secondary''primary'Color variant
labelstring-Text label
requiredbooleanfalseWhether the field is required (shows red asterisk)
disabledbooleanfalseWhether the checkbox is disabled
classNamestring-Additional CSS class
styleCSSProperties-Inline styles

Also accepts all standard <input> HTML attributes (except type and size).

Mobile considerations

  • The clickable area extends to include the label so the 44px tap target is met even with size="sm" styles.
  • Check / uncheck animation respects prefers-reduced-motion: reduce.
  • Group multiple Checkboxes inside a list with at least --tui-space-3 vertical gap so finger taps don't miss neighbors.