Skip to main content
PimentCSS v1.0.1, what's new
Home

Tags

Removable tags, filter chips, and pressed toggle states.

Styles live in scss/components/_tag.scss. Tags are compact labels for filters, metadata, or status. Use static variants for read-only chips, and interactive tags as toggle buttons with aria-pressed.

Static tags

Semantic backgrounds with optional leading icon. Disabled uses .tag--disabled on a <span> (not interactive).

Tag
Neutral
Tag
Information
Tag
Success
Tag
Warning
Tag
Error
Tag
Disabled

Interactive tags

Dashed border when unselected; solid fill when selected (.tag--interactive-selected). The plus icon hides when selected and a dismiss icon appears.

Default
Hover
Focus
Disabled
Unselected
Selected

Filter chips (live)

Click tags to toggle selection. Each control is a <button class="tag tag--interactive"> with aria-pressed (data-tags-live wires the demo).

Use for multi-select filters; expose the group with role="group" and an accessible name.

JavaScript

Class reference

ClassDescription
.tagBase inline-flex chip
.tag__labelTruncated label text
.tag__icon16px icon (add or dismiss)
.tag__icon--addPlus icon when unselected (hidden when selected)
.tag--neutral.tag--errorStatic semantic variants
.tag--disabledStatic disabled appearance
.tag--interactiveToggle button (dashed border)
.tag--interactive-selectedSelected toggle (solid fill)

Customize (Sass)

  1. Tag spacing

    Adjust padding, gap, and icon size for denser toolbars.
    @use "pimentcss-design-system" with (
      $tag-gap: 0.25rem,
      $tag-padding-x: 0.5rem,
      $tag-icon-size: 1rem
    );
  2. Rebuild CSS

    Run after editing _tag.scss.
    npm run build:css

Accessibility (RGAA / WCAG)

Tags and filter chips

  • Static tags, use <span> when not actionable; decorative icons need aria-hidden="true".
  • Interactive tags, use <button type="button"> with aria-pressed="true|false" for toggle chips.
  • Groups, wrap related filters in role="group" with aria-label or a visible heading referenced by aria-labelledby.
  • Disabled, use the native disabled attribute on buttons; do not rely on color alone for state.

Next steps