Icon
1em in the current text color. The kit ships the glyphs its own components need; register your own with provideVigdxIcons .
vig-icon
import { Icon, provideVigdxIcons } from '@vigdx/ui/icon';Default icons
VIG_DEFAULT_ICONS , the built-in set the kit's components use. Pass its key as name .
closecheckchevron-downchevron-upchevron-leftchevron-rightchevrons-leftchevrons-rightchevrons-upchevrons-downarrow-uparrow-downsortgrip-verticaleyeeye-offinfosuccesswarningerrorcalendarfilterfilter-filledcolumnsdownloadminusplussearchexternal-linkusermore-horizontalinboxmenulistgridhomeuploadfilestarpipetteplaypausezoom-inzoom-outrotate-cwrotate-ccwmaximize
Size and color
1em square and stroked with currentColor : size it with a font-size class and color it with a text color. strokeWidth makes a single glyph bolder or lighter.
Inline icons sit on the text baseline and follow its size.
Meaningful icons
ariaLabel ; next to a text label, leave it decorative.
- Two-factor login
- Recovery email
- Backup codes
- Not generated
Custom icons
provideVigdxIcons merges glyphs into the registry by name, adding new ones or overriding built-ins. An IconDefinition is SVG path data on a 24×24 viewBox ; outline by default, filled with fill: 'currentColor' .
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="icon"][data-part="svg"] { … }: 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="icon"]
| Part | Element | data-state |
|---|---|---|
svg | <svg> . | — |
Accessibility
- By default the icon is
aria-hidden="true"and its SVG is not focusable, so screen readers skip it. - With
ariaLabelthe icon becomesrole="img"with that name. Use it only when the icon is the sole carrier of the information. - Icon-only controls get their name from the control, not the icon: pass
ariaLabelto the button and keep the icon decorative. - Meaningful icons need a 3:1 contrast against their background (WCAG 1.4.11); never use color alone to tell states apart.
- Glyphs are path data rendered by Angular bindings, not HTML strings, so no
innerHTMLor sanitizer bypass is involved.
API
Icon
vig-iconRenders a registered icon at 1em in the current text color. Decorative by
default (hidden from assistive tech); pass ariaLabel for a meaningful one.
Size it with the font size, e.g. class="text-[1.25em]".
| Name | Type | Default | Description |
|---|---|---|---|
ariaLabel | string | undefined | undefined | Accessible name; when set the icon is exposed as |
name | string | — | Name of a registered icon (see |
strokeWidth | number | undefined | undefined | Per-instance stroke width override, e.g. a bolder check inside a small box. |