Provides shared state for a series of checkboxes. Styled wrapper for CheckboxGroup from Base UI with support for parent checkboxes, indeterminate state, and nested groups.
import { Checkbox } from "@/components/ui/checkbox"; import { CheckboxGroup } from "@/components/ui/component"; import { Label } from "@/components/ui/label"; export default function CheckboxGroupDefault() { return ( <div className="flex items-center justify-center w-full min-h-screen bg-background"> <CheckboxGroup aria-label="Select frameworks" defaultValue={["next"]}> <Label> <Checkbox value="next" /> Next.js </Label> <Label> <Checkbox value="vite" /> Vite </Label> <Label> <Checkbox value="astro" /> Astro </Label> </CheckboxGroup> </div> ); }
Part of coss — browse the full library on 21st.dev.