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

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

valueundefined
string[]

Controlled selected values

defaultValue[]
string[]

Default selected values for uncontrolled usage

onValueChangeundefined
(values: string[]) => void

Callback when selection changes

orientation"vertical"
"horizontal" | "vertical"

Layout direction of the checkboxes

labelundefined
string

Group label text

errorundefined
string

Error message to display

disabledfalse
boolean

Disable all checkboxes in the group