Skip to content
Nana UI

Checkbox Group

View .md Download

Groups related nana-checkbox elements under one label, lays them out, and propagates a shared size/disabled. Tracks the set of checked values and emits them on change.

Cheese Mushroom
Terminal window
npm install @nana-tec/ui-components
import "@nana-tec/ui-components/checkbox-group";
<nana-checkbox-group label="Toppings">
<nana-checkbox value="cheese">Cheese</nana-checkbox>
<nana-checkbox value="mushroom">Mushroom</nana-checkbox>
</nana-checkbox-group>

Properties

PropertyAttributeTypeDefaultDescription
disabledbooleanfalseDisable every child checkbox
errorstring | undefinedError message shown beneath the group
labelstring | undefinedGroup label
orientation'horizontal' | 'vertical''vertical'Lay items out in a column (default) or a row
requiredbooleanfalseMarks the group required (visual asterisk on the legend)
sizeCheckboxSize | undefinedSize applied to every child checkbox

Events

EventDescription
nana-changeFired when any child toggles (`detail.value` = checked values)

Slots

SlotDescription
(default)One or more `nana-checkbox` elements

CSS parts

PartDescription
::part(legend)The group label
::part(items)The layout container
EventTypeDescription
nana-changeCustomEventFired when any child toggles (detail.value = checked values)
SlotDescription
(default)One or more nana-checkbox elements
PartDescription
legendThe group label
itemsThe layout container
  • Keyboard accessible
  • Screen-reader labels
  • Focus-visible states
  • ARIA roles and states
  • WCAG 2.2 AA contrast
Explore Checkbox Group interactively Every state, prop, and edge case — with live controls — in Storybook.
View in Storybook