Skip to the content

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 Chip alone.
  • Chips mixed with buttons or text — compose a Flex row 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 ul with role="list" (kept where the bullet is removed) and one li per chip.
  • Name it with aria-label, or aria-labelledby pointing at a visible heading.
  • Opening a chip description closes any other open one in the group.

Properties

Besides the props above, the group accepts the native <ul> attributes and the grid placement props (area, alignSelf, justifySelf).

See also