Components
Checkbox
Material 3 Expressive checkbox with animated checkmark and indeterminate stroke, invalid styling, and state-layer halo.
import { Checkbox } from "@/components/ui/checkbox";
import { Field, FieldLabel } from "@/components/ui/field";
export default function Particle() {
return (
<Field className="w-auto">
<FieldLabel>
<Checkbox defaultChecked />
Accept terms and conditions
</FieldLabel>
</Field>
);
}
Installation
pnpm dlx shadcn@latest add @taut-ui/checkbox
Usage
import { Checkbox } from "@/components/ui/checkbox"<label className="inline-flex items-center gap-2.5 text-sm">
<Checkbox defaultChecked />
Accept terms
</label>Examples
With Description
Receive alerts when deployments complete or require approval.
import { Checkbox } from "@/components/ui/checkbox";
import {
Field,
FieldDescription,
FieldLabel,
} from "@/components/ui/field";
export default function Particle() {
return (
<Field className="max-w-xs">
<FieldLabel>
<Checkbox defaultChecked />
Enable desktop notifications
</FieldLabel>
<FieldDescription>
Receive alerts when deployments complete or require approval.
</FieldDescription>
</Field>
);
}
Indeterminate
"use client";
import { useState } from "react";
import { Checkbox } from "@/components/ui/checkbox";
import { Field, FieldLabel } from "@/components/ui/field";
type SelectionState = "indeterminate" | "checked" | "unchecked";
export default function Particle() {
const [state, setState] = useState<SelectionState>("indeterminate");
function handleChange() {
setState((prev) =>
prev === "indeterminate"
? "checked"
: prev === "checked"
? "unchecked"
: "indeterminate",
);
}
return (
<Field className="w-auto">
<FieldLabel>
<Checkbox
checked={state === "checked"}
indeterminate={state === "indeterminate"}
onCheckedChange={handleChange}
/>
Select all items
</FieldLabel>
</Field>
);
}
Invalid
import { Checkbox } from "@/components/ui/checkbox";
import { Field, FieldLabel } from "@/components/ui/field";
export default function Particle() {
return (
<Field className="w-auto" invalid>
<FieldLabel>
<Checkbox aria-invalid />
Agree to privacy policy
</FieldLabel>
</Field>
);
}
Disabled
import { Checkbox } from "@/components/ui/checkbox";
import { Field, FieldLabel } from "@/components/ui/field";
export default function Particle() {
return (
<Field className="w-auto" disabled>
<FieldLabel>
<Checkbox defaultChecked disabled />
Enforced by organization policy
</FieldLabel>
</Field>
);
}
API Reference
Checkbox
Wraps Base UI Checkbox.Root with built-in animated check and indeterminate indicators.
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | - | Controlled checked state |
defaultChecked | boolean | false | Initial uncontrolled checked state |
onCheckedChange | (checked: boolean) => void | - | Called when the checked state changes |
indeterminate | boolean | false | Renders the horizontal indeterminate bar |
parent | boolean | false | Marks the checkbox as the parent inside CheckboxGroup |
disabled | boolean | false | Disables interaction and dims the control |
className | string | - | Additional CSS classes |