Component v1.1.0 Foundations

Tag

Compact removable or icon-enhanced label for filters, metadata, and statuses.

API Stable 2.1 WCAG notes Ready Dark mode
Selector
ui-tag
Package
@ngnova/ui/tag

Import

Standalone Tailwind v4
import { UiTagComponent } from '@ngnova/ui/tag';

Usage & variants

Live examples use the public ui-tag API, paired with the exact snippet a product team would paste into an Angular app.

API Reference

Removable status tag

Compact removable or icon-enhanced label for filters, metadata, and statuses.

AngularPublishedNeeds review

Production guidance

Use these notes to decide when the component belongs in a product workflow and what to verify before shipping.

When to use

Use Tag when the label may be removed or acts like a selected filter chip.

Watch for

Long tag content truncates inside the tag.

Product recipes

Apply Tag in distinct, copyable product scenarios—not just an isolated component state.

Filter tag

Emit removed and let the parent update filter state.

Angular template ui-tag-recipe.example.html
1
2
3
<ui-tag variant="info" removable removeLabel="Remove Angular filter" (removed)="remove('angular')">
  Angular
</ui-tag>

Release classification

Use semantic, non-removable tags to classify a release without implying an action.

Angular template ui-tag-recipe.example.html
1
2
3
4
5
<div class="flex flex-wrap gap-2" aria-label="Release classification">
  <ui-tag variant="success">Stable</ui-tag>
  <ui-tag variant="info">Angular 22</ui-tag>
  <ui-tag variant="warning">Prerelease docs</ui-tag>
</div>

API Reference

Inputs and outputs are semver-sensitive public API. Keep examples aligned with this table.

Inputs

variant 'default'
'default' | 'success' | 'warning' | 'danger' | 'info'

Semantic color treatment.

size 'md'
'sm' | 'md'

Tag padding and text size.

icon ''
string

Legacy leading icon text; prefer a projected uiTagIcon SVG for crisp rendering.

uiTagIcon n/a
directive

Marks and normalizes a projected decorative leading icon.

ariaLabel ''
string

Accessible label for icon-heavy or visually compact tags.

removable false
boolean

Shows an accessible remove button.

removeLabel 'Remove tag'
string

Accessible label for the remove action.

Outputs

removed OutputEmitterRef<void>

Emits when the remove button is pressed.

Accessibility

  • The remove control is a native button with a configurable accessible label.
  • ariaLabel promotes the tag to a named group for icon-heavy or visually compact content.
  • Projected uiTagIcon content is normalized and hidden from assistive technology.

Keyboard behavior

  • Tab reaches removable tag buttons.
  • Enter or Space activates the remove button.

Testing guidance

  • Assert removed emits from the remove button and removeLabel is applied.
  • Use UiTagHarness to locate by visible text, inspect removability, and activate removal.