Checkbox Group

Forms

A group component for managing multiple checkboxes with shared state. Supports both composition and list-based APIs.

Import

import { 
  CheckboxGroup, 
  CheckboxGroupItem, 
  CheckboxList 
} from "@/components/ui/checkbox-group";

Usage

Composition API

Build checkbox groups with individual items

Notification Preferences

Selected: email

List API

Pass options as an array for simpler usage

Select Features

Track user behavior

Export data to CSV/Excel

Programmatic access

Horizontal Layout

Display checkboxes in a row

Days Available

With Error

Display validation errors

Terms & Conditions

You must accept all terms to continue

Disabled

Disabled state for all checkboxes

Preferences

API Reference

PropTypeDefaultDescription
valuestring[]undefinedControlled selected values
defaultValuestring[][]Default selected values for uncontrolled usage
onValueChange(values: string[]) => voidundefinedCallback when selection changes
orientation"horizontal" | "vertical""vertical"Layout direction of the checkboxes
labelstringundefinedGroup label text
errorstringundefinedError message to display
disabledbooleanfalseDisable all checkboxes in the group

Related Components