Chip
vig-tag is the same component under a second selector). Make it closable when the user can remove what it stands for; use a badge for counts and status dots.
vig-chip vig-tag [vigChipIcon]
import { Chip, ChipIcon } from '@vigdx/ui/chip';Variants
variant picks a soft tone: secondary (default), primary , accent , ghost and the four status colors.
Sizes
size is md (default, about 24px tall) or sm , a denser tag for tables and toolbars.
Closable
closable adds a remove button that emits closed (formerly dismissible and dismissed ). The chip does not hide itself: remove the item from your state, as in this filter bar.
Labels and truncation
closeAriaLabel replaces the remove button's accessible name, e.g. for translations. Long labels truncate to the available width and show the full text as a tooltip.
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
- The chip itself is plain text; only the remove button is focusable. It is a native
<button>, activated with Enter or Space, with a 24px pointer target around its smaller icon (WCAG 2.5.8). - The remove button is named “Remove” plus the label by default (
chipRemoveAriaLabel); override it per chip withcloseAriaLabel. - After a chip is removed its button disappears: move focus somewhere sensible, such as the next chip or the filter input, when users remove chips with the keyboard.
- Focus shows a ring in the chip's own color; all tones meet WCAG AA contrast for their text.
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.
|