Checkbox
Binary input with full tristate support (checked / unchecked / indeterminate), label association, semantic colors, and keyboard activation.
Preview
Switch the framework picker (top-right of the panel) to render the same demo live in React, Vue, or Angular — same class names, ARIA, and visual output across all three.
Playground
Flip props to see how the component responds. The snippet below updates as you change options.
Installation
Sisyphos UI ships unified packages for React, Vue, and Angular. Pick the one that matches your stack — every framework exports the same component classes, ARIA semantics, and CSS tokens.
$ pnpm add @sisyphos-ui/reactThen import the bundled stylesheet once at app entry: import "@sisyphos-ui/react/styles.css";
Usage
import { useState } from "react";
import { Checkbox } from "@sisyphos-ui/react";
export function Terms() {
const [agreed, setAgreed] = useState(false);
return (
<Checkbox
checked={agreed}
onChange={setAgreed}
label="I agree to the terms"
/>
);
}Semantic colors
Sizes
Three sizes match the scale system used by Input and Button.
API
| Prop | Type | Default | Description |
|---|---|---|---|
| checked* | boolean | — | Current checked state. Always controlled. |
| indeterminate | boolean | false | Renders the tristate "mixed" mark and exposes `aria-checked="mixed"`. Activating promotes to `checked=true`. |
| onChange | (checked: boolean) => void | — | Called with the next boolean when the user toggles the input. |
| label | ReactNode | — | Optional label rendered next to the box. |
| color | "neutral" | "primary" | "success" | "error" | "warning" | "info" | "primary" | Semantic color used when checked or indeterminate. |
| size | "xs" | "sm" | "md" | "lg" | "xl" | "md" | Box dimensions. |
| radius | "radius-xs" | "radius-sm" | "radius-md" | "radius-lg" | "radius-xl" | — | Border radius scale. |
| disabled | boolean | false | Disables interaction and applies the disabled visual. |
| id | string | — | Custom id used to link the label. |
The full API including refs, ARIA attributes, and HTML passthroughs lives in the package README on npm.
Accessibility
Adheres to the Checkbox WAI-ARIA design pattern.
aria-checkedreflects the visual state —"true","false", or"mixed"for the indeterminate value.- The DOM
indeterminateflag is kept in sync alongside the ARIA attribute (assistive tech reads both). aria-disabledmirrorsdisabled; the underlying<input>is also natively disabled to block submission.- The label is wired through
htmlFor/idso screen readers announce the label when the input is focused.
Keyboard interactions
| Key | Action |
|---|---|
| Space | Toggles the value. Indeterminate checkboxes promote to checked. |
| Tab | Moves focus to the next focusable element. |