Skip to content

Checkbox Group

Select any combination of independent options in one labeled group.

Usage

Release channels

Choose one or more independent release channels.

Choose one or more independent release channels.

Disabled choice

Keep one choice visible but unavailable while other choices remain interactive.

Keep one choice visible but unavailable while other choices remain interactive.

Controlled

Let the parent own the current value and apply accepted changes back to the component.

Let the parent own the current value and apply accepted changes back to the component.

API

Vue package: @sectile/vue/checkbox-group

Components
  • CheckboxGroupRoot
  • CheckboxGroupItem
  • CheckboxGroupIndicator

Props

CheckboxGroupRootProps

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

defaultValue

Initial value used when the component owns its state.

disabled

Whether interaction is unavailable.

form

ID of the native form associated with the control.

items

Ordered item values managed by the component.

label

Accessible name announced for the control.

modelValue

Current value when state is controlled by the parent.

name

Name used for native form submission.

readonly

Whether the value can be inspected but not changed.

required

Whether the control must contain a valid value before submission.

CheckboxGroupItemProps

as

Element or component rendered for this part.

asChild

Whether to merge this part into its single child instead of rendering a wrapper.

disabled

Whether interaction is unavailable.

required

Whether the control must contain a valid value before submission.

value

Current value exposed by this contract.

Slots

CheckboxGroupRootSlotProps

disabled

Whether interaction is unavailable.

readonly

Whether the value can be inspected but not changed.

value

Current value exposed by this contract.

Events

CheckboxGroupRoot

update:modelValue

Emitted when the component requests a new controlled value.

Other types

CheckboxGroupValueChangeHandler

ts
type CheckboxGroupValueChangeHandler = (value: readonly string[]) => void

Parts

Shared scope: [data-scope="checkbox-group"]. Combine it with a part selector to keep styles local to this component.

PartSelectorRoleExtra attributes
root[data-part="root"]Defines the component boundary and owns its composed parts.
item[data-part="item"]Represents one selectable or actionable item.
indicator[data-part="indicator"]Shows state or position without replacing the primary content.

Keyboard interaction

KeyBehavior
TabMove focus into and out of the group.
SpaceToggle the focused checkbox item.

Accessibility

The labeled group preserves each item as an independently focusable checkbox with checked and disabled state.

See the corresponding WAI-ARIA pattern for the host accessibility contract.

Released under the MIT License.