Malevich

Elements / Display/

Tags-group

Runtime-measured tag list with "+K more" overflow.

Tags-group

Horizontal collection of Tag components with optional runtime-driven overflow. Without data-max-rows, the group simply wraps. With it, the runtime hides tags beyond row N and appends a "+K more" tag.

Per the answered design question recorded with this component: runtime-measured overflow, not author-counted.

When to use

Variants

Variant Class Use for
No-cap .tags-group All tags visible, wraps naturally
Capped .tags-group[data-max-rows="N"] Hide tags past row N, show +K more

Anatomy

<!-- Unlimited wrap -->
<div class="tags-group">
  <span class="tag -muted">React</span>
  <span class="tag -muted">TypeScript</span>
  <span class="tag -muted">CSS</span>
</div>

<!-- Trim to 2 rows -->
<div class="tags-group" data-max-rows="2">
  <span class="tag -muted">React</span>
  <span class="tag -muted">TypeScript</span>
  <span class="tag -muted">CSS</span>
  <span class="tag -muted">Vite</span>
  <span class="tag -muted">Vitest</span>
  <!-- … many more … -->
</div>

The runtime (initTagsGroup, auto-registered) measures wrapped layout, hides tags whose row index ≥ N, and appends or updates a .tag.-muted.tags-group__overflow element with text +K more. On container resize (via ResizeObserver), it re-runs.

For environments without JS, the cap is a no-op and all tags remain visible — the page still works.

Tokens used

Tag styling is inherited from the Tag component.

Accessibility

Edge cases

Do

Don't