Checkbox
A wrapper for Base UI Checkbox and CheckboxGroup with label/description support, select-all parent checkbox, orientation control, and controlled state.
Checkbox
Single checkbox — label + description + disabled
indeterminate — controlled tri-state
CheckboxWrapper
items — list with descriptions and disabled
parentLabel — select-all with indeterminate state
value + onValueChange — controlled group
Selected: email, sms
orientation: horizontal
CheckboxGroup primitive
Manual composition
Installation
npx shadcn@latest add @glrk-ui/checkboxIf you haven't set up the prerequisites yet, check out registry setup.
Usage
Single checkbox — Checkbox
import { Checkbox } from "@/components/ui/checkbox"
<Checkbox label="Accept terms and conditions" />
<Checkbox
label="Email notifications"
description="Receive updates about your account."
/>
<Checkbox label="Disabled" disabled />Group — CheckboxWrapper
import { CheckboxWrapper } from "@/components/ui/checkbox"
<CheckboxWrapper
defaultValue={["email"]}
items={[
{ value: "email", label: "Email", description: "Notify via email." },
{ value: "sms", label: "SMS" },
{ value: "push", label: "Push notifications" },
{ value: "locked", label: "Cannot change", disabled: true },
]}
/>Select-all parent checkbox
Set parentLabel to add a parent checkbox that shows indeterminate when partially selected:
<CheckboxWrapper
defaultValue={["email"]}
parentLabel="All notifications"
items={[
{ value: "email", label: "Email" },
{ value: "sms", label: "SMS" },
{ value: "push", label: "Push" },
]}
/>Controlled
const [value, setValue] = useState<string[]>(["email"])
<CheckboxWrapper
value={value}
onValueChange={(v) => setValue(v)}
parentLabel="Select all"
items={[
{ value: "email", label: "Email" },
{ value: "sms", label: "SMS" },
]}
/>Horizontal orientation
<CheckboxWrapper
orientation="horizontal"
defaultValue={["react"]}
items={[
{ value: "react", label: "React" },
{ value: "vue", label: "Vue" },
{ value: "svelte", label: "Svelte" },
]}
/>Reference
checkboxItemT
Prop
Type
Checkbox
Prop
Type
CheckboxWrapper
Prop
Type