Chip

Interactive pill-shaped element for filtering, selecting, and tagging. Supports single and multi-select via Chip.Group.

Setup

import { Chip } from '@fragments-sdk/ui';

Examples

Default

Basic filled chip

Loading preview...

Outline

Chip with border using the "outline" alias for "outlined"

Loading preview...

Selected

Chip in selected state across variants

Loading preview...

With Avatar

Chip with a leading avatar image

Loading preview...

With Remove

Removable chip with dismiss button

Loading preview...

Chip Group

Multi-select chip set with shared state

Loading preview...

Chip Group with Custom Labels

Use explicit values when chip labels are custom JSX

Loading preview...

Disabled

Chip in disabled state

Loading preview...

Props

PropTypeDefaultDescription
childrenRequirednodeNot setChip label text
variantenumfilledoutlinedoutlinesoftfilledVisual style variant
sizeenumxssmmdlgmdChip size
selectedbooleanfalseWhether the chip is in a selected state
iconnodeNot setIcon element rendered before the label
avatarnodeNot setAvatar element rendered before the label
onRemovefunctionNot setMakes chip removable. Called when X is clicked.
valuestringNot setValue identifier used by Chip.Group for selection tracking
disabledbooleanfalse
onClickfunctionNot set

Usage Guidelines

When to use

  • Filtering content by categories or tags
  • Multi-select scenarios like choosing interests or skills
  • Toggling options in a compact pill-shaped control
  • Displaying removable user-applied filters

When not to use

  • Display-only status labels (use Badge)
  • Navigation between views (use Tabs)
  • Binary on/off state (use Switch)
  • Primary call-to-action (use Button)

Best practices

  • Keep chip labels short (1-3 words)
  • Use Chip.Group for multi-select sets with shared state
  • Use onRemove only when users should be able to dismiss the chip
  • Pair avatar chips with user-related selections (assignees, reviewers)
  • Provide an explicit value on Chip when using non-string/custom JSX children inside Chip.Group
Accessibility
  • Chips are buttons and use aria-pressed for selection state
  • Chip.Group is a grouping wrapper; add role/aria-label when needed for assistive context
  • Remove buttons include descriptive aria-label with chip text
  • Disabled chips are properly excluded from interaction