Skip to main content

Starwind UI v3.0 beta is now available! Read the migration guide

Checkbox Group

Runtime example adjustment

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

Framework Availability

Astro Available React Available

Checkbox Group is available for Astro and React.

Usage

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

API Reference

Styled Component API

These props are added or materially changed by the installed Astro styled component. Standard HTML attributes remain available through the inherited interfaces noted below. Follow the Primitive and Runtime links for lower-level behavior props.

Checkbox Group

Inherits div attributes. Omits `defaultValue` and `onChange`.

Contains the following additional props:

Prop Type Default Toggle details
defaultValue string[]
Description
Sets the initial value when the component is uncontrolled.
Classification
Primitive override
Primitive prop
checkbox-group.Root.defaultValue

Primitive And Runtime API

Use these references when you need the lower-level behavior APIs behind Checkbox Group.

Runtime API

Checkbox Group primitive
createCheckboxGroup 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 for the underlying unstyled anatomy and behavior API.