Skip to main content

Chip

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.

Desktop viewport
Tablet viewport
Mobile viewport

When to use

  • Show a compact value, let a user remove it, or turn a choice on or off.
  • Use Badge to show status.
  • Use Checkbox when the choice needs a form value.
  • Use Multi Select when the user must search a long list of choices.
  • Use Button when 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.

Desktop viewport
Tablet viewport
Mobile viewport

Locked

Set locked to keep the remove control visible and block removal. A locked chip ignores Delete and Backspace when it has focus.

Desktop viewport
Tablet viewport
Mobile viewport

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.

Desktop viewport
Tablet viewport
Mobile viewport

Selectable

Set selectable to render a button with aria-pressed. By default, its plus or check icon makes the state visible without color.

Desktop viewport
Tablet viewport
Mobile viewport

Controlled state

Pass pressed and onPressedChange when the page owns the state. The chip reports the next state and waits for the new prop.

Desktop viewport
Tablet viewport
Mobile viewport

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.

Desktop viewport
Tablet viewport
Mobile viewport

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.

Desktop viewport
Tablet viewport
Mobile viewport

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.

Desktop viewport
Tablet viewport
Mobile viewport

A set of chips

Name the group when its chips answer one question. Keep the selected items in one state value.

Desktop viewport
Tablet viewport
Mobile viewport

With a tooltip

Use Tooltip.Trigger asChild to add a short hint to a chip. The chip passes its ref to its button.

Desktop viewport
Tablet viewport
Mobile viewport

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.

Desktop viewport
Tablet viewport
Mobile viewport

API Reference

Chip

The default chip accepts native span props. A selectable chip accepts native button props except type and aria-pressed.

PropTypeDefaultDescription
appearance?"pill" | "square""pill"The shape: fully rounded, or small corner radii.
asChild?booleanfalsePass the chip props to one child with the same semantics.
icon?ReactNodeSVG icon before the label; replaces the default state icon.
onRemove() => voidAdds a remove button; requires removeLabel.
removeLabelstringAccessible name of the remove button.
locked?booleanfalseBlocks removal and shows a lock icon.
removeButtonTabIndex?number0Use -1 when a parent list owns keyboard focus.
selectable?booleanfalseRenders a toggle button.
pressedbooleanControlled state. Requires onPressedChange.
defaultPressed?booleanfalseInitial state when the chip owns its state.
onPressedChange?(pressed: boolean) => voidReceives the next state after a press.
size?"xs" | "sm" | "md" | "lg" | "xl""xs"Height and spacing on the Button scale.

onRemove and selectable cannot be combined. A plain chip renders a span; a selectable chip renders a button.

Data AttributeValueDescription
data-slot"chip"The root element.
data-slot"chip-label"The label wrapper, with display: contents.
data-slot"chip-icon"The optional leading icon.
data-slot"chip-remove"The optional remove button.
data-state"on" | "off"The selectable state.
data-appearance"pill" | "square"The shape of the chip.
data-size"xs" | "sm" | "md" | "lg" | "xl"The size of the chip.
data-lockedpresentRemoval is blocked.
data-shakepresent while it shakesPresence-only. A locked chip shakes when the user tries to remove it. Not set under reduced motion.