Chip
Small, compact controls: an action, a filter, or a value someone entered. Chips share the small corner radius of text fields, so they read as part of a form rather than as buttons.
Install
npx shadcn@latest add @nelumbo/chipAssist
A shortcut to a related action, usually with an icon. Elevated chips stand out on images and maps.
Filter
Toggles, read out as pressed or not. When selected, a chip fills in and a check slides in. If it has an icon, the icon turns into the check.
Brand color
Selected filter chips can use the accent container.
Input
A value someone entered, such as a recipient or a tag, with a button to remove it. Backspace or Delete on that button removes the chip too.
To
Suggestion
Suggested replies or searches, usually text only. Put them in a scrolling row on small screens.
Usage
import { Chip, FilterChip, InputChip, ChipGroup } from "@/components/ui/chip"<Chip icon="event">Add to calendar</Chip><ChipGroup aria-label="Topics"> <FilterChip selected={design} onSelectedChange={setDesign}>Design</FilterChip> <FilterChip icon="eco">Vegan</FilterChip> <FilterChip trailingIcon="arrow_drop_down">Price</FilterChip></ChipGroup><InputChip avatar="ML" onRemove={() => remove("maya")}>Maya Lin</InputChip>Props
| Prop | Type | Default | Notes |
|---|---|---|---|
Chip variant | "assist" | "suggestion" | "assist" | A button; supports asChild |
icon / trailingIcon | IconName | Chip and FilterChip; InputChip takes icon | |
elevated | boolean | false | Chip and FilterChip: shadow instead of a border |
FilterChip selected | boolean | Controlled; or defaultSelected, with onSelectedChange | |
FilterChip color | "auto" | "neutral" | "brand" | "auto" | Selected fill |
InputChip avatar | string | ReactNode | Image URL, or initials in a circle | |
InputChip onRemove | () => void | Shows the remove button | |
ChipGroup scroll | boolean | false | One scrolling row instead of wrapping |