# Checkbox Group

<FrameworkCodeSwitcher>
  <div slot="astro">
```astro
---
import { Checkbox } from "@/components/starwind/checkbox";
import { CheckboxGroup } from "@/components/starwind/checkbox-group";
---

<CheckboxGroup defaultValue={["email"]} aria-label="Notification channels">
  <Checkbox name="notifications" value="email" label="Email" />
  <Checkbox name="notifications" value="sms" label="SMS" />
  <Checkbox name="notifications" value="push" label="Push" />
</CheckboxGroup>
```
  </div>
  <div slot="react">
```tsx
import { Checkbox } from "@/components/starwind/checkbox";
import { CheckboxGroup } from "@/components/starwind/checkbox-group";

export function Example() {
  return (
    <CheckboxGroup defaultValue={["email"]} aria-label="Notification channels">
      <Checkbox name="notifications" value="email" label="Email" />
      <Checkbox name="notifications" value="sms" label="SMS" />
      <Checkbox name="notifications" value="push" label="Push" />
    </CheckboxGroup>
  );
}
```
  </div>
</FrameworkCodeSwitcher>

> **Info:** The group owns its default value and emits one `starwind:value-change` event when a child
checkbox changes. Child checkboxes keep their native form names and values.

## Installation

```bash
npx starwind@latest add checkbox-group
```

## Usage

Use `disabled` on the group to disable every child without repeating the prop.

```astro
<CheckboxGroup disabled aria-label="Unavailable channels">
  <Checkbox value="email" label="Email" />
  <Checkbox value="sms" label="SMS" />
</CheckboxGroup>
```

## Framework Availability
Checkbox Group is available for Astro and React.
Astro available; React available
| Framework | Status | Notes |
| --- | --- | --- |
| Astro | available | - |
| React | available | - |
## API Reference
### CheckboxGroup
| Prop | Type | Required | Default | Kind | Description |
| --- | --- | --- | --- | --- | --- |
| `defaultValue` | `string[]` | No | - | Primitive override | Sets the initial value when the component is uncontrolled. |
- Inherits div attributes. Omits `defaultValue` and `onChange`.
### Primitive And Runtime API
Behavior, state, events, form participation, and imperative methods are documented in the lower-level references.
- Primitive: [Checkbox Group Primitive](/docs/primitives/checkbox-group/)
- Runtime factory: [`createCheckboxGroup`](/docs/runtime/#create-checkbox-group) from `@starwind-ui/runtime/checkbox-group`

## Changelog

### v1.0.0

- Added Checkbox Group as a Runtime-backed component with grouped ownership and native form participation.
- See the [Checkbox Group Primitive](/docs/primitives/checkbox-group/) for the underlying unstyled anatomy and behavior API.