cv-chip-group
Selection container for slotted cv-chip elements.
Use cv-chip-group when several chips represent one choice set or a multi-select facet list. The group owns selection state, keeps child selected states in sync, and adds roving keyboard focus for arrow-key navigation.
Usage
Anatomy
<cv-chip-group selection-mode="multiple">
<cv-chip value="photos">Photos</cv-chip>
<cv-chip value="docs" removable>Docs</cv-chip>
</cv-chip-group>Shadow structure:
<cv-chip-group> (host)
└── <div part="base" role="group">
└── <slot> ← cv-chip childrenAttributes
| Attribute | Type | Default | Description |
|---|---|---|---|
selection-mode | String | "none" | "none", "single", or "multiple" |
value | String | "" | Single value or space-separated multiple values |
orientation | String | "horizontal" | "horizontal" or "vertical" roving key direction |
disabled | Boolean | false | Disables group selection and child chip interaction |
Slots
| Slot | Description |
|---|---|
(default) | Slotted cv-chip items |
CSS Parts
| Part | Description |
|---|---|
base | Group layout container |
Events
| Event | Detail | Description |
|---|---|---|
cv-input | { value, changedValue, selected, source } | Emitted by group before/at user commit |
cv-change | { value, changedValue, selected, source } | Emitted by group after selection commit |
cv-chip-group emits user events only from user interaction. Programmatic value updates sync selected chips without emitting events.
Keyboard
| Key | Behavior |
|---|---|
Enter/Space | Activates the focused chip |
| Arrow keys | Move roving focus according to orientation |
Home/End | Move focus to first or last chip |
Selection modes
| Mode | Behavior |
|---|---|
none | Chips still emit their own cv-chip-action; the group does not select |
single | One selected value at a time; clicking the selected chip clears it |
multiple | Adds or removes values; host value serializes them with spaces |