Tag
BetaData displayOpen in the workshop
A category or an applied filter, optionally removable.
.xg-tag (+ button to remove) · --plainExample and markup
Live, from xg-ui.css and xg-ui.js. Switch the brand and mode on the example itself, or for the whole site in the header.
Markup
<div class="xg-chipbar">
<span class="xg-tag">Country: US<button type="button" aria-label="Remove filter: Country US">×</button>
</span>
<span class="xg-tag">Format: Video<button type="button" aria-label="Remove filter: Format Video">×</button>
</span>
<span class="xg-tag xg-tag--plain">CTV</span>
<button class="xg-btn xg-btn--ghost xg-btn--sm" type="button">Clear all</button>
</div>States
Hover, focus and pressed are forced here with .is-hover, .is-focus and .is-active so they can be seen side by side; in a product they come from :hover, :focus-visible and :active.
| State | Tag |
|---|---|
| Removable | Country: US |
| Plain | CTV |
When to use it
Use it for
applied filters above a table; geo, format and device labels.
Not for
status (Status badge); actions (Button).
Rules
- Removable tags show an × button; removing a filter updates the table at once.
- Tags are square-cornered: badges are pills, tags are not.
Accessibility
- The remove button has aria-label="Remove filter: Country US".
Every color pair this component uses is measured for both brands in light and dark on the Accessibility page.
Related
Also in Data display: Data table, Pagination, KPI card, Status badge, Avatar, Progress, Chart, Tooltip, Empty state, Skeleton, Spinner. Used in the patterns Reporting table.
Status Beta: usable; class names may still change in a minor release, with a note (see Releasing).