Checkbox

A 20px box toggle with checked and indeterminate states.

Preview#

Controls
import { Checkbox, CheckboxIndicator } from "raft-ui";

<Checkbox />

{/* The box alone, inside a control that owns the checkbox semantics */}
<CheckboxIndicator checked />

This uncontrolled checkbox starts checked and manages its own state.

Controlled state: unchecked

States#

Label#

Indicator#

CheckboxIndicator is the box on its own, with no input or role. Use it inside a row or menu item that already owns the checkbox semantics.

Selection#WIP

3 of 8 selected

API#WIP

shapedefault: "square"
"square" | "circle"
Box shape. One size: a 20px box inside a 44 × 36px hit area; checked is an ink block with the mark knocked out.
checked
boolean
Controlled checked state. Pair with onCheckedChange.
defaultCheckeddefault: false
boolean
Initial checked state for uncontrolled usage.
indeterminatedefault: false
boolean
Mixed state, rendered as a dash. Extension beyond the original component.
onCheckedChange
(checked: boolean, details) => void
Called when the checkbox is ticked or unticked.
disableddefault: false
boolean
Dims the box and blocks interaction.
render
ReactElement | (props, state) => ReactElement
Replace the rendered element or compose with another component (Base UI).
...props
Base UI Checkbox.Root.Props
Form props (name, value, required, form) plus Base UI props.
checked
boolean
Draws the checked ink block with the mark. Required.
markdefault: "check"
"check" | "minus"
Mark drawn when checked. Use minus for a mixed state.
shapedefault: "square"
"square" | "circle"
Box shape, as on Checkbox.
disableddefault: false
boolean
Disabled look. Visual only; the owning control handles interaction.
previewOnHoverdefault: false
boolean
Shows a faint mark on an unchecked box while its group ancestor is hovered.
...props
ComponentPropsWithRef<"span">
The 20px box as a decorative span (aria-hidden). Checkbox renders it internally; use it alone inside a row or menu item that owns the checkbox role and state.