Rebar UI

1.0

imitation

Checkbox

Check, clear or mixed.

CheckboxCheck, clear, mixed
Error

Required to continue.

Disabled
Disabled on
Long label

In context

Task checklistA mixed parent over its tasks

Native appearance

Nativeappearance="native" renders the browser checkbox (sized by --rebar-checkbox-native-size, tinted by --rebar-checkbox-accent); card and label tokens style the row.
Checked
Indeterminate
Disabled

Props

PropTypeRequiredDefault
descriptionReactNodeNo—
variant"default" | "card" | undefinedNodefault
appearance"default" | "custom" | "native" | undefinedNocustom
labelClassNamestring | undefinedNo—
invalidboolean | undefinedNo—
bionicboolean | undefinedNo—
bionicOptionsBionicOptions | undefinedNo—

Accessibility

A real Radix checkbox (role="checkbox", Space toggles, a visible focus ring) inside a real <label>, so the whole row is the target. checked="indeterminate" is announced as mixed. Pass aria-label when there is no visible label.

data-rebar-* attributes

data-rebar-component="checkbox" on the control; data-rebar-part="indicator" on the mark, "label" on the text; Radix sets data-state.

Migrating to Ant Design

AntD's Checkbox takes the same checked/onChange shape (event-based) and children as its label: a close, low-risk rename.

Description and card variant

description adds a secondary line under the label, linked to the checkbox with aria-describedby. variant="card" makes the whole label a bordered card that tints when checked, for option lists such as plans or permissions.

<Checkbox variant="card" description="Billed monthly">Pro plan</Checkbox>

appearance="native"

appearance="native" renders a real <input type="checkbox"> in the platform look (accent from --rebar-checkbox-native-accent), as a row with --rebar-checkbox-native-gap and -align. labelClassName styles the label.