Skip to main content

Starwind UI v3.7 is here with stable Vue and Svelte, the new Chart component, and full RTL support. Read the release notes

Checkbox Group

Installation

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 styled component. Standard HTML attributes remain available through the inherited interfaces noted below. Expand a prop to see named type definitions and framework-specific imports. 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

View version history v1.1.1 5 releases

v1.1.1

  • In Vue, this component now needs Vue 3.5.21 or newer.
  • Maintenance release for the component files that the CLI copies into your project. Only internal code changed, such as unused code and import order. Behavior stays the same.

v1.1.0

  • In Svelte, a defined value that you pass when CheckboxGroup mounts now stays under your control, as in React and Vue. To change it, use bind: or update your state in the change callback. A form reset keeps it. If you pass undefined at mount, CheckboxGroup keeps its own state.
  • In Svelte, CheckboxGroup now follows push() and splice() on a $state array that you pass as value.

v1.0.2

  • React and Vue Checkbox Group now use the group value to select their children, including when a child has its own checked or defaultChecked value.
  • Reduced the JavaScript loaded by Checkbox Group when it is used without Field.

v1.0.1

  • In React, you can cancel a change before it applies. The component then keeps its previous state, and it shows only the changes that apply.

v1.0.0

  • Added Checkbox Group. It gets its behavior from Starwind Runtime. The group controls its checkboxes and sends their values with the native form.
  • See the Checkbox Group Primitive for the unstyled parts and the behavior API.