Zephora UI

Form

Checkbox

Checkbox with a built-in clickable label, controlled/uncontrolled checked state and an indeterminate (mixed) mode.

Import

import { Checkbox } from "@zephora/react";

Examples

Basic

Indeterminate parent

A classic select-all pattern using `indeterminate`.

Sizes and invalid

API

Checkbox props

PropTypeDefaultDescription
checkedbooleanControlled checked state.
defaultCheckedbooleanfalseInitial checked state (uncontrolled).
onCheckedChange(checked: boolean) => voidCalled with the next checked state.
indeterminatebooleanfalseVisually indeterminate ("mixed") state; also sets aria-checked="mixed".
size"sm" | "md" | "lg""md"Control size.
invalidbooleanfalseMarks the field invalid: sets aria-invalid and error styling.
childrenReactNodeLabel content; the label wraps the input so it is clickable.
unstyledbooleanfalseHeadless mode — drops Zephora classes so your own CSS can style it.
…restInputHTMLAttributes<HTMLInputElement>Remaining native input props (name, disabled, required…) are forwarded.

Keyboard

KeyAction
SpaceToggles the checked state.
TabMoves focus.