Chip
onToggle) or removable (onRemove), never both. Reading never removes: the name
and the × are separate 44px targets.When to use
- 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").
Usage
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} |
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) orcontained(filled, for counts).color:primary(default) orneutral. A selected chip also bolds its label.monosets the code font for ids. The label ellipsizes atmaxWidth(default100%); the full text stays in the Popover title or thetitleattribute.
Accessibility
- Every target is a native
buttonin the tab order; Enter / Space toggle or open; Esc closes the description. - Selectable chips expose
aria-pressed; description triggers exposearia-expanded. - The × is named
Remove {label}(removeLabel), the (i)About {label}(infoLabel). - The
iconand the status dot are decorative: the label andstatusLabelname the chip.
Properties
color"neutral""primary"'primary'descriptionstringnonedisabledbooleanfalseiconReactNodenoneinfoLabelstring`About ${label}`label *stringnonemonobooleanfalseonRemove((event: MouseEvent<HTMLButtonElement, MouseEvent>) => void)noneonToggle((selected: boolean, event: MouseEvent<HTMLButtonElement, MouseEvent>) => void)noneremoveLabelstring`Remove ${label}`selectedbooleannonesize"small""medium"'medium'status"neutral""live""working""success""warning""danger""info"nonestatusLabelstringnonevariant"outlined""contained"'outlined'Besides the props above, the chip accepts the native
<span>attributes and the grid placement props (area,alignSelf,justifySelf).