Skip to content
Fleetline

Tag

Usage

Use a static tag for metadata people scan (vehicle features, depot). Use a removable tag to show applied filters that can be cleared one by one. Use a selectable chip for quick on/off filters above a list. Use a badge for status, and checkboxes in a form when the choice is part of data entry.

Anatomy

  1. Container — span.tag (static/removable) or button.tag.tag--selectable
  2. Leading icon (optional) — .tag__icon; check mark .tag__check appears when selected
  3. Label — .tag__label, truncates
  4. Remove button (removable) — button.tag__remove, 24×24 minimum

Examples

States marked hover and focus-visible are frozen with .is-hover and .is-focus-visible. Those classes share their rule with the real pseudo-class; never use them in product code.

Tag / chip

Static tags describe; removable tags show applied filters; selectable chips toggle a filter.

  • Refrigerated
  • Depot north
  • Hazardous goods certified (ADR class 3)
  • Overdue
  • Vans
Depot south
<ul class="tag-list" role="list" aria-label="Active filters">
  <li><span class="tag tag--removable"><span class="tag__label">Overdue</span><button type="button" class="tag__remove" aria-label="Remove filter: Overdue"><svg class="" aria-hidden="true" focusable="false"><use href="#icon-x"></use></svg></button></span></li>
  <li><span class="tag tag--removable"><span class="tag__label">Vans</span><button type="button" class="tag__remove is-hover" aria-label="Remove filter: Vans"><svg class="" aria-hidden="true" focusable="false"><use href="#icon-x"></use></svg></button></span></li>
</ul>

<div class="tag-list" role="group" aria-label="Filter by status">
  <button type="button" class="tag tag--selectable" aria-pressed="true"><svg class="tag__check" aria-hidden="true" focusable="false"><use href="#icon-check"></use></svg><span class="tag__label">Overdue</span></button>
  <button type="button" class="tag tag--selectable" aria-pressed="true"><svg class="tag__check" aria-hidden="true" focusable="false"><use href="#icon-check"></use></svg><span class="tag__label">In workshop</span></button>
  <button type="button" class="tag tag--selectable" aria-pressed="false"><svg class="tag__check" aria-hidden="true" focusable="false"><use href="#icon-check"></use></svg><span class="tag__label">In service</span></button>
</div>

API

HookValuesPurpose
.tagblock classStatic tag
.tag--removable + .tag__removemodifier + partTag with a remove button
.tag--selectable on <button aria-pressed>modifier + attributeFilter chip; aria-pressed="true" = selected
.tag__label | __icon | __checkpart classesContent
.tag-listwrapper classWrapping row with gaps (use ul role="list" or role="group")
disabledattributeUnavailable chip
.is-hover | .is-focus-visibledocs-only classFreeze states

Do and don't

Do show selection with a check mark and fill.

Selected only by a slightly darker fill.

Don’t rely on color to show which filters are on.

aria-label="Remove filter: Overdue"

Do name the remove button after the tag.

aria-label="Remove" on every tag

Don’t use the same name for every remove button.

Accessibility

Keyboard interaction
KeyBehavior
TabMoves to each chip or remove button
Enter / SpaceToggles a chip; activates a remove button

Tokens

Custom propertyPurpose
--size-control-smTag height
--radius-mdShape (8px, same as controls)
--color-bg-subtle, --color-border-default, --color-text-defaultResting tag
--color-selected-bg | -fg | -borderSelected chip
--color-action-secondary-bg-hover, --color-action-ghost-bg-hoverHover fills
--color-bg-muted, --color-text-disabledDisabled chip
--focus-ring-*Focus ring