Skip to the content

Chip

A small rounded item that names a thing — a tag, a pick, a filter — and can say its state. The handler you pass picks its behaviour: static, selectable (onToggle) or removable (onRemove), never both. Reading never removes: the name and the × are separate 44px targets.
Data Display

When to use

Use when
  • Picked items the user can remove: applied filters, an agent's policies.
  • A pick list where each chip toggles on or off.
  • A name that carries a state or a longer description ("docs-sync · running").
Avoid when
  • One choice out of a few, always visible — use Option.
  • A read-only status badge — use Label with status.
  • An action ("Save", "Add") — use Button.

Usage

staticremovable
import { Chip } from '@apollion-dsi/core/elements/chip';

<Chip label="caveman" icon={<Icon icon={users} />} />
<Chip label="caveman" selected={on} onToggle={setOn} />
<Chip label="caveman" description="Compressed output…" onRemove={remove} />
The chip has…
Name target
Second target
nothing
text (not focusable)
—
description only
button → opens the Popover
—
onToggle
button with aria-pressed → toggles
(i) → Popover, if description
onRemove
text, or button → Popover if description
× IconButton Remove {label}
Scrolls sideways inside the table. The page does not.

onToggle receives the next selected state and the click event; selected is controlled and required with it.

Description

description adds a Popover titled with the full label. A tap opens it; a second tap, a tap outside or Esc closes it, and focus stays on the trigger. With a mouse, hover opens it too. Inside a ChipGroup, one description is open at a time.

Status

status draws a StatusDot before the label; statusLabel adds the state in words as visually hidden text. The leading slot takes an icon or a status, never both. The same seven statuses drive StatusDot, Label status and Chip status:

  • neutral — hollow ring: idle, off, disabled.
  • live — success dot with a pulsing halo: connected, streaming.
  • working — information arc turning around the dot: running, syncing, checking.
  • success, warning, danger, info — solid: done; needs attention or paused; failed or blocked; queued.

live and working move on the theme's indicator motion channel. Status is independent of variant: feedback colours belong to the dot, never to the chip fill. Pick the piece by interaction: StatusDot alone beside a name, Label for a read-only badge, Chip for an item the user touches.

  • docs-sync running
  • web-hooks live
  • nightly sync failed

Sizes and variants

  • size: medium (default) is a 44px pill with 44px targets. small (32px) is below the touch floor — dense desktop-only rows, never a phone.
  • variant: outlined (default; selected adds a light fill and a palette border) or contained (filled, for counts).
  • color: primary (default) or neutral. A selected chip also bolds its label.
  • mono sets the code font for ids. The label ellipsizes at maxWidth (default 100%); the full text stays in the Popover title or the title attribute.
outlinedcontainedsmall removable

Accessibility

  • Every target is a native button in the tab order; Enter / Space toggle or open; Esc closes the description.
  • Selectable chips expose aria-pressed; description triggers expose aria-expanded.
  • The × is named Remove {label} (removeLabel), the (i) About {label} (infoLabel).
  • The icon and the status dot are decorative: the label and statusLabel name the chip.

Properties

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

See also