Badgesibling
Badge is display-only; Chip is interactiveChip
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
| Prop | Type | Default | Description |
|---|---|---|---|
childrenRequired | node | Not set | Chip label text |
variant | enumfilledoutlinedoutlinesoft | filled | Visual style variant |
size | enumxssmmdlg | md | Chip size |
selected | boolean | false | Whether the chip is in a selected state |
icon | node | Not set | Icon element rendered before the label |
avatar | node | Not set | Avatar element rendered before the label |
onRemove | function | Not set | Makes chip removable. Called when X is clicked. |
value | string | Not set | Value identifier used by Chip.Group for selection tracking |
disabled | boolean | false | — |
onClick | function | Not 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