Skip to Content
ComponentsCheckbox

Checkbox

The Checkbox component renders a Windows 98 styled checkbox with a label.

Props

PropTypeDefaultDescription
checkedboolean-Controlled checked state.
defaultCheckedbooleanfalseInitial checked state for uncontrolled usage.
disabledbooleanfalseDisables the checkbox.
onCheckedChange(checked: boolean) => void-Checked-state change callback for controlled usage.
childrenReactNode-Label content.
classNamestring-Adds custom classes to the input.

Migration

Use onCheckedChange={setChecked} instead of reading event.target.checked from a native onChange handler.

Examples

Basic states

Controlled

ARIA

Checkbox uses a native input type="checkbox" and an associated label, so checked and disabled states are communicated through native form semantics.

Keyboard

KeyBehavior
SpaceToggles the checkbox.

SSR

Checkbox is a client component through the package root. Server markup stays stable when checked or defaultChecked values are stable between server and client.

Last updated on