Tag
Native controls work. Demo links and submissions stay inside this specimen. This example scrolls horizontally at this width.
Source markup
<!-- @dsCard group="Display" height=100 -->
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<title>Tag</title>
<style>
/* Layout of the demo states only. No component values are set here. */
.demo {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
gap: var(--space-md);
max-width: 960px;
}
.state { display: flex; flex-direction: column; gap: var(--space-3xs); }
.state__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); }
/* .post-tags carries margin-block: var(--space-xl) var(--space-md) for article flow.
Zeroed here so the card keeps its marker height. */
.demo .post-tags { margin-block: 0; }
/* Static copies of the live states: a:hover and the :focus-visible floor in bundle.css. */
.tag.is-hover { text-decoration: underline; }
.tag.is-focus { outline: var(--focus-width) solid var(--focus-ring); outline-offset: var(--focus-offset); }
</style>
</head>
<body>
<div class="demo">
<div class="state">
<p class="t-label">Rest and current</p>
<div class="state__row">
<a class="tag tag--accent" href="/journal/" aria-current="page">All</a>
<a class="tag" href="/categories/cybersecurity/">Cybersecurity</a>
<a class="tag" href="/categories/privacy/">Privacy</a>
<a class="tag" href="/categories/foss/">FOSS</a>
</div>
</div>
<div class="state">
<p class="t-label">Post-tags</p>
<div class="post-tags">
<a class="tag" href="/tags/encryption/">#encryption</a>
<a class="tag" href="/tags/compliance/">#compliance</a>
<a class="tag" href="/tags/monero/">#monero</a>
</div>
</div>
<div class="state">
<p class="t-label">Hover</p>
<div class="state__row">
<a class="tag is-hover" href="/tags/linux/">#linux</a>
</div>
</div>
<div class="state">
<p class="t-label">Focus</p>
<div class="state__row">
<a class="tag is-focus" href="/tags/linux/">#linux</a>
</div>
</div>
</div>
</body>
</html>
A small mono label for metadata: the topic tags under an article, the items in a category filter row, the featured badge on a pricing row.
Use it for one or two words of fact about the thing beside it. Do not use it for state: live, success, warning and error belong to StatusBadge. A tag never carries a sentence.
The consumer provides the element and the text: <a class="tag"> when the tag navigates, <span class="tag"> when it only labels, as the featured badge on .pricing-row does. The container is the consumer’s too: .post-tags under an article body, .journal-filters on a listing, or any flex row with a space-2xs gap.
Rest is color-semantic-text-muted on color-semantic-bg-raised, inside a hairline color-semantic-border-base border at radius-sm, set in font-family-mono at font-scale-sm, padded space-3xs space-2xs, with a space-3xs gap for an optional leading glyph. That pairing clears AA at about 6.4:1. .tag--accent marks the current or featured item: color-semantic-accent-primary on color-amber-medium, border transparent, so the box keeps the size of a plain tag. A tag that is a link underlines on hover and takes the focus-ring outline at focus-width and focus-offset from the accessibility floor.
Do pair .tag--accent with aria-current="page" where it marks the current filter, and keep one accent to a row. Do not put color-semantic-text-faint in a tag: it fails AA at this size. Do not fill a tag with color-semantic-accent-primary; the tint is the accent form, and a fill would force color-semantic-text-on-accent text. Do not add shadow-phosphor: the glow is for one element per view, not for metadata.
Accessibility
Section titled “Accessibility”- Role: no ARIA role.
<a class="tag">is a link and<span class="tag">is plain text. - Accessible name: the visible text between the tags; there is no
aria-label, so the label must read on its own. - Keyboard: a link tag takes Tab and Enter. Space, Escape and the arrow keys do nothing; a
<span class="tag">is not interactive and is out of the tab order. - Target size: only link tags are targets.
.tagrenders 32px tall fromfont-scale-sm,space-3xsblock padding and theborder-width-hairlineborder, and the narrowest tag in the preview is 42px wide, so the border box clears the 24px floor of SC 2.5.8. - Announcement: none.
.tag--accentwitharia-current="page"names the current filter; if a filter row swaps its results, the live region belongs on that container.
Hand-written from themes/noiz/assets/css/components.css (.tag, .tag–accent).