ChipGroup
A list that lays
Chips out: it wraps with an xs gap and keeps one chip description open at a
time.Data Display
When to use
Use when
- Two or more chips side by side: picked items, a pick list, tags.
- Chips with descriptions — the group closes the open one when another opens.
Avoid when
- A single chip — render the
Chipalone. - Chips mixed with buttons or text — compose a
Flexrow and give the chips their own group.
Usage
import { Chip } from '@apollion-dsi/core/elements/chip';
import { ChipGroup } from '@apollion-dsi/core/elements/chip-group';
<ChipGroup aria-label="Policies">
{policies.map((policy) => (
<Chip key={policy.id} label={policy.name} description={policy.summary} onRemove={() => remove(policy.id)} />
))}
</ChipGroup>;The group has no breakpoint logic: it wraps to whatever width its container gives it. Each item shrinks, so a long
chip ellipsizes instead of overflowing. null and false children are skipped.
Accessibility
- Renders a
ulwithrole="list"(kept where the bullet is removed) and oneliper chip. - Name it with
aria-label, oraria-labelledbypointing at a visible heading. - Opening a chip description closes any other open one in the group.
Properties
Name
Type
Default
Description
aria-labelstringnoneAccessible name of the list ("Policies", "Selected personas"). Name it
whenever the chips are not introduced by a visible heading — then point
`aria-labelledby` at that heading instead.
childrenReactNodenoneThe chips. Each child becomes one list item; `null` / `false` children
are skipped.
Besides the props above, the group accepts the native
<ul>attributes and the grid placement props (area,alignSelf,justifySelf).