Talisman LogoTalisman Logo Design System
Browse documentation
Components

Chip

Shows an applied filter or a selected value as a compact pill, optionally with a button to remove it.

Stableimport { Chip } from "@repo/ui/chip";Source
size
variant
<Chip dismissible dismissLabel="Remover filtro de revisor" size="md" variant="default">Revisor: Marina Costa</Chip>

Which one to use

Chip, Tag, Badge and Status badge look alike. They answer different questions.

Component What it is Interactive Example
Chip (this page) An applied filter or selected value, often removable. Yes “Revisor: Marina Costa” with ×.
Tag A label in three sizes, with an optional icon. No “Aprovado” with a check icon.
Badge The same as a Tag, always sm. No “Novo” next to a menu item.
Status badge A processing status picked from a backend code. No “Processando” with an icon.

Ask: does the user act on it? If they can remove it or open it, use Chip. If it only describes the item, use Tag or Badge.

When to use

  • To list the filters applied to a table or a list, each one removable.
  • To show the values chosen in a multi-select.
  • As the trigger of an editable filter (variant="filter" with asChild).

When not to use

  • A label that only describes an item. Use Tag or Badge.
  • A processing status. Use Status badge.
  • Switching between views or sections. Use Tabs.
  • A boolean setting. Use Switch or Checkbox.

Variants

variant sets how the chip looks when it is selected.

Variant Use for
default Applied values. Selected uses the light brand fill.
filter An editable filter in a compact rectangular shape.
info Selected state with information color.
warning Selected state with warning color.
inverted Selected state with high contrast.

Sizes

Size Height Use for
sm 28px Dense toolbars.
compact 32px Filter bars.
md 36px Default. Forms and lists.

States

Selected comes from selected, which sets data-selected. Selected chips appear in the second row of Variants. Hover and pressed fills are built in.

Examples

Add a leading icon with icon.

Set dismissible and onDismiss for a removable chip. Name what the button removes with dismissLabel.

The filter variant is meant to wrap a trigger with asChild.

Content

  • Show the field and the value when the field is not obvious: “Revisor: Marina Costa”, “Status: Pendente”.
  • Sentence case, no period.
  • Write dismissLabel as the action and the object: “Remover filtro de revisor”. Apps pass it translated.

Do and don’t

DoName what the dismiss button removes.
Don'tDon't make a label look removable when nothing happens. Use Tag for static labels.

Accessibility

  • The chip root is a div and is not focusable. Only the dismiss button (type="button") receives focus, and Enter and Space activate it.
  • The dismiss button has aria-label from dismissLabel (default “Remover”). Use a specific label so a list of chips is not a list of identical “Remover” buttons.
  • The × button is 24px, which meets the minimum hit target. Its focus uses a ring (focus-visible:ring-1).
  • Selection is exposed only through data-selected, not through ARIA. Do not rely on it for screen readers: pair the chip with text such as “Status: Pendente”.
  • Color is never the only signal for selection in default: the fill and text change, and the label stays visible. For info and warning, keep the label explicit.
  • When you use asChild, you own the semantics. Wrap a real button or a.
  • The icon is aria-hidden.

Code

import { Chip } from "@repo/ui/chip";

<Chip
  dismissLabel="Remover filtro de revisor"
  dismissible
  icon={User}
  onDismiss={handleRemove}
  selected
>
  Revisor: Marina Costa
</Chip>

// Filter trigger
<Chip asChild size="compact" variant="filter">
  <button type="button">Status</button>
</Chip>

Props

PropTypeDefaultDescription
asChildbooleanfalseRenders the child element with chip styles, using Radix Slot. `icon` and `dismissible` are ignored in this mode
dismissiblebooleanfalseShows an × button that calls `onDismiss`
dismissLabelstringRemoverAccessible name of the dismiss button. Pass translated copy from the app
iconReact.ElementType—Icon component shown before the label
onDismissfunction—Called when the × button is clicked
selectedboolean—Marks the chip as selected through `data-selected`
size"compact" | "md" | "sm"mdHeight, padding and type size
variant"default" | "filter" | "info" | "inverted" | "warning"defaultAppearance of the chip when idle and when selected

Known issues

Issue Effect
The root div has hover and active color changes but no role, no tabindex. A chip without asChild looks clickable on hover but cannot be focused or activated from the keyboard.
The root uses focus:ring-2, but a div cannot take focus. The focus ring never shows for the default chip. It only works when asChild wraps a focusable element.
selected is only a data-selected attribute. No aria-pressed or aria-selected: screen readers do not hear the selected state.
The dismiss button uses opacity-80 and hover:opacity-100. Transparency for hover feedback, against the no-translucency rule.
dismissLabel defaults to the Portuguese word “Remover”. A hardcoded default inside an i18n-free package. Apps must pass the translated label.
icon and dismissible are ignored with asChild. The props do nothing in that mode and give no warning.
Edit this page on GitHub