Checkbox Group

A checkbox group allows a user to select multiple items from a list of options.

React frameworks
<CheckboxGroup defaultValue={["nextjs"]}>
  <Label>React frameworks</Label>
  <FieldGroup>
    <Checkbox value="nextjs">
      <CheckboxControl />
      <Label>Next.js</Label>
    </Checkbox>
    <Checkbox value="remix">
      <CheckboxControl />
      <Label>Remix</Label>
    </Checkbox>
    <Checkbox value="gatsby">
      <CheckboxControl />
      <Label>Gatsby</Label>
    </Checkbox>
  </FieldGroup>
</CheckboxGroup>

Installation

npx shadcn@latest add @dotui/checkbox-group

Usage

Use CheckboxGroup to allow users to select multiple items from a list of options.

import { CheckboxGroup } from "@/components/ui/checkbox-group";
import { Checkbox, CheckboxControl } from "@/components/ui/checkbox";
import { FieldGroup, Label } from "@/components/ui/field";
<CheckboxGroup defaultValue={["nextjs"]}>
	<Label>React frameworks</Label>
	<FieldGroup>
		<Checkbox value="nextjs">
			<CheckboxControl />
			<Label>Next.js</Label>
		</Checkbox>
		<Checkbox value="remix">
			<CheckboxControl />
			<Label>Remix</Label>
		</Checkbox>
	</FieldGroup>
</CheckboxGroup>

Selection

Use defaultValue for uncontrolled checkbox groups, or value and onChange for controlled checkbox groups.

<CheckboxGroup defaultValue={["nextjs"]}>{/* ... */}</CheckboxGroup>
const [frameworks, setFrameworks] = useState<string[]>(["nextjs"]);

<CheckboxGroup value={frameworks} onChange={setFrameworks}>
	{/* ... */}
</CheckboxGroup>;

Playground

Use the controls below to experiment with different checkbox group props and see the live preview and code update.

Select frameworks
orientation
<CheckboxGroup defaultValue={["react"]}>
  <Label>Select frameworks</Label>
  <FieldGroup>
    <Checkbox value="react">
      <CheckboxControl />
      <Label>React</Label>
    </Checkbox>
    <Checkbox value="vue">
      <CheckboxControl />
      <Label>Vue</Label>
    </Checkbox>
    <Checkbox value="angular">
      <CheckboxControl />
      <Label>Angular</Label>
    </Checkbox>
  </FieldGroup>
</CheckboxGroup>

Examples

Default

React frameworks

With Description

React frameworksYou can pick any frameworks.

Invalid

React frameworks
Please select a framework.

Disabled

React frameworks

ReadOnly

React frameworks

Required

React frameworks

Cards

React frameworks

API Reference

CheckboxGroup

A checkbox group allows a user to select multiple items from a list of options.

PropType
ReactNode | function
boolean
boolean
DOMRenderFunction<"div", CheckboxGroupRenderProps>
string[]
string[]
function

Checkbox

A checkbox allows a user to select multiple items from a list of individual items, or to mark one individual item as selected.

PropType
ReactNode | function
boolean
RefObject<HTMLInputElement | null>
boolean
boolean
boolean
boolean
DOMRenderFunction<"div", CheckboxFieldRenderProps>
function

Last updated on 5/22/2026