Skip to content

Checkbox Group

Provides shared state to a series of checkboxes.

API Reference

Installation

pnpm dlx shadcn@latest add @frontal-labs/checkbox-group

Usage

import { Checkbox } from "@/components/ui/checkbox";
import { CheckboxGroup } from "@/components/ui/checkbox-group";
<CheckboxGroup>
  <Label>
    <Checkbox defaultChecked />
    Next.js
  </Label>
  <Label>
    <Checkbox />
    Vite
  </Label>
  <Label>
    <Checkbox />
    Astro
  </Label>
</CheckboxGroup>

API Reference

CheckboxGroup

Styled wrapper for CheckboxGroup from Base UI. Provides shared state management for a group of checkboxes with flex column layout.

Examples

For accessible group labelling and validation, prefer wrapping checkbox groups with Field and Fieldset. See the related example: Checkbox group field.

With Disabled Item

Parent Checkbox

Nested Parent Checkbox

Form Integration