Skip to content

Tag / Chip

A compact label for categorisation, filtering, or selection. Supports colour variants, removable mode, and avatar prefix.

Preview

DefaultDesignPublishedDraftArchived

Rounded (pill)

LabelReactStable

With avatar and remove

AM Alice Martin BC Bob Chen

Variants

VariantUse case
defaultNeutral category labels
primaryBrand-related or highlighted tags
successPositive status or completed
warningNeeds attention
errorNegative status or removed

Props

PropTypeDefaultDescription
variant'default' | 'primary' | 'success' | 'warning' | 'error''default'Colour variant
roundedbooleanfalsePill shape
removablebooleanfalseShow remove button
onRemove() => void--Remove handler
avatarstring--Initials for leading avatar
childrenReact.ReactNode--Tag label

Code example

React

tsx
import { Tag } from '@thepace/lexicon/components';

<Tag variant="primary" rounded>React</Tag>
<Tag variant="success" removable onRemove={() => {}}>Published</Tag>
<Tag avatar="AM">Alice Martin</Tag>

Vanilla HTML

html
<span class="lex-tag lex-tag--primary lex-tag--rounded">React</span>
<span class="lex-tag lex-tag--success">
  Published
  <button class="lex-tag__remove" aria-label="Remove">&times;</button>
</span>
<span class="lex-tag">
  <span class="lex-tag__avatar">AM</span>
  Alice Martin
</span>

CSS class reference

ClassPurpose
.lex-tagBase tag styles
.lex-tag--primaryPrimary variant
.lex-tag--successSuccess variant
.lex-tag--warningWarning variant
.lex-tag--errorError variant
.lex-tag--roundedPill shape
.lex-tag__removeRemove button
.lex-tag__avatarLeading avatar circle

Accessibility

  • Removable tags use <button> with aria-label="Remove".
  • When used for filtering, wrap in a group with role="group" and aria-label.
  • Selected/active tags should use aria-pressed="true".

Guidelines

Do

  • Use tags to label, categorise, or filter content.
  • Keep labels to 1–2 words.
  • Use the rounded variant for filter chips in search interfaces.

Don't

  • Don't use tags for status — use Badge instead.
  • Don't use more than 5 colour variants in one view.
  • Don't make tags interactive without clear affordance (hover/focus states).

Released under the MIT License. A product by the pace.