Tag
Compact removable or icon-enhanced label for filters, metadata, and statuses.
- Selector
- ui-tag
- Package
- @ngnova/ui/tag
Import
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.
Removable status tag
Compact removable or icon-enhanced label for filters, metadata, and statuses.
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.
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.
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.
| Name | Type | Default | Description |
|---|---|---|---|
variant | 'default' | 'success' | 'warning' | 'danger' | 'info' | 'default' | Semantic color treatment. |
size | 'sm' | 'md' | 'md' | Tag padding and text size. |
icon | string | '' | Legacy leading icon text; prefer a projected uiTagIcon SVG for crisp rendering. |
uiTagIcon | directive | n/a | Marks and normalizes a projected decorative leading icon. |
ariaLabel | string | '' | Accessible label for icon-heavy or visually compact tags. |
removable | boolean | false | Shows an accessible remove button. |
removeLabel | string | 'Remove tag' | Accessible label for the remove action. |
Outputs
removed OutputEmitterRef<void> Emits when the remove button is pressed.
| Name | Type | Description |
|---|---|---|
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.