Checkbox

A square toggle with checked and indeterminate states.

Preview#

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

<Checkbox />

Controlled and uncontrolled#

This uncontrolled checkbox starts checked and manages its own state.

Controlled state: unchecked

Variants#

Sizes#

States#

Label#

Selection#WIP

3 of 8 selected

API#WIP

PropTypeDefaultDescription
size"sm" | "md""sm"Visual size of the box. Brutal renders sm/md as 14px/16px; Elegant renders them as 16px/18px.
variant"default" | "primary""default"Visual treatment for the checked background.
checkedbooleanControlled checked state. Pair with onCheckedChange.
defaultCheckedbooleanfalseInitial checked state for uncontrolled usage.
indeterminatebooleanfalseMixed state, rendered as a dash. Extension beyond the original component.
onCheckedChange(checked: boolean, details) => voidCalled when the checkbox is ticked or unticked.
disabledbooleanfalseDims the box and blocks interaction.
renderReactElement | (props, state) => ReactElementReplace the rendered element or compose with another component (Base UI).
...propsBase UI Checkbox.Root.PropsForm props (name, value, required, form) plus Base UI props.