Tag
vig-tag [vigChipIcon]
import { Chip, ChipIcon } from '@vigdx/ui/chip';Variants and icons
variant takes the shared variants ( success , warning , error , info , primary , secondary …) plus accent . Mark a leading icon with vigChipIcon : any icon works, sized at 1em and hidden from assistive tech.
Rounded and sizes
rounded gives a pill shape instead of the --radius-chip corners; size is md (default) or the denser sm .
Removable
closable adds a remove button that emits closed ; remove the item from your state. closeAriaLabel names the button, e.g. for translations (the default is the locale's “Remove” plus the label).
Styling hooks
Internal elements carry a stable data-part and the component's data-scope; both are public API, so removing one is a breaking change. Select a part by both, e.g. [data-scope="chip"][data-part="root"] { … }: the pair stays within this component when kit components nest, and also reaches parts in overlay panels, which render outside the host. State is exposed through aria-* and, where listed, a data-state; literal values are checked by the API gate, values computed from the component's state follow its documented types. Other data-* attributes listed below (such as data-opening while an overlay animates) are API too. See Customizing.
Scope: [data-scope="chip"]
| Part | Element | data-state |
|---|---|---|
root | — | |
icon | [vigChipIcon] slot. | — |
label | — | |
close | closable ). | — |
Accessibility
- A tag is plain text: keep the label meaningful without its color. The icon is decorative (
aria-hidden). - The remove button is a native
<button>with a 24px pointer target and a focus ring in the tag's own color; all variants meet WCAG AA text contrast.
API
Chip
vig-chip, vig-tagA compact tag for filters, selections and statuses.
vig-tag is an alias selector of the same component, for status tags
(PrimeNG p-tag territory): <vig-tag label="Paid" variant="success" />.
Both take the same inputs, so there is one implementation, one set of
tokens and one remove button to keep accessible.
| Name | Type | Default | Description |
|---|---|---|---|
closable | boolean | undefined | undefined | Adds a close (remove) button that emits |
closeAriaLabel | string | undefined | undefined | Accessible name of the close button; defaults to |
dismissible | boolean | false | Deprecated: Use `closable`; still honored when `closable` is unset. — |
dismissLabel | string | undefined | undefined | Deprecated: Use `closeAriaLabel`; still honored when `closeAriaLabel` is unset. — |
label | string | — | — |
rounded | boolean | false | Pill shape ( |
size | ChipSize | 'md' |
|
variant | ChipVariant | 'secondary' | — |
| Name | Payload | Description |
|---|---|---|
closed | void | The close button was activated. The chip does not hide itself. |
dismissed | void | Deprecated: Use `closed`; emits alongside it. — |
Templates and directives
| Selector | Export | Description |
|---|---|---|
[vigChipIcon] | ChipIcon | Marks projected content as the chip's leading icon, e.g.
|