A compact label for a value or a selectable choice. Press a selectable chip to turn it on or off. A chip can also have a separate remove control.
When to use
- Show a compact value, let a user remove it, or turn a choice on or off.
- Use
Badgeto show status. - Use
Checkboxwhen the choice needs a form value. - Use
Multi Selectwhen the user must search a long list of choices. - Use
Buttonwhen a press runs an action without a selected state.
Removable
Pass onRemove and a removeLabel that names the value. Press the remove button to dismiss it.
Locked
Set locked to keep the remove control visible and block removal. A locked chip ignores Delete and Backspace when it has focus.
Leading icon
Pass icon to place an SVG before the label. On a selectable chip, it replaces the plus or check icon. Change its weight to show the selected state without color alone.
Selectable
Set selectable to render a button with aria-pressed. By default, its plus or check icon makes the state visible without color.
Controlled state
Pass pressed and onPressedChange when the page owns the state. The chip reports the next state and waits for the new prop.
Appearance
A chip is a pill by default. Set appearance="square" and size="sm" to match the value tags in Multi Select, such as for chips beside a form field. A one-line square chip is 2px shorter than a pill chip of the same size. A long square label wraps. A long pill label stays on one line and ends in an ellipsis at the width of its container.
Size
Chip uses the Button size scale, from xs (24px) to xl (48px). A pill chip is as tall as a Button of the same size. Use xs in a data row, and match the size of the buttons beside a chip.
Disabled
A disabled selectable chip keeps its state visible. It does not change state when the user presses it. Set aria-disabled in place of disabled to keep the chip in the tab order: it looks the same and does not change. On a removable chip, aria-disabled also disables the remove button.
A set of chips
Name the group when its chips answer one question. Keep the selected items in one state value.
With a tooltip
Use Tooltip.Trigger asChild to add a short hint to a chip. The chip passes its ref to its button.
Polymorphism
Chip accepts asChild to pass its props to one child. A selectable chip needs a button child. A removable chip needs a non-interactive container child so its remove button is not nested inside another control.
API Reference
Chip
The default chip accepts native span props. A selectable chip accepts native button props except type and aria-pressed.
onRemove and selectable cannot be combined. A plain chip renders a span; a selectable chip renders a button.