A small decorative or labelled graphic. Uses the existing shared PrimeIcons stylesheet/font, or a host-supplied native SVG/graphic in its default slot. It introduces no icon JavaScript runtime or implicit Lucide download.
<qds-icon name="prime:pi-briefcase" label="Portfolio investment"></qds-icon>
<qds-icon name="pi-check"></qds-icon><span>Reviewed</span>
<qds-icon label="Production asset">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor">
<path d="M3 21V9l9-6 9 6v12z"></path>
</svg>
</qds-icon>
Load /assets/components/icon/qds-icon.js as a module for standalone use.
| Property / attribute | Type / default | Contract |
|---|---|---|
name |
string, empty | prime:pi-* or legacy pi-* name from the shared icon helper. Other/invalid names retain the custom-graphic slot. |
label |
string, empty | Nonblank text exposes role="img" with that accessible name. Empty/whitespace makes the entire icon decorative (aria-hidden="true"). |
The default slot supplies a native SVG or other graphic when there is no supported named glyph. It remains in the DOM when a named glyph is shown again. The icon has no click behavior, keyboard stop or custom events; use an action component for interactive icons. Slotted graphics are part of the icon’s single image/decorative semantics, so avoid interactive content in the slot. Provide adjacent visible text for critical meanings and avoid relying on color alone.
Part: icon. --qds-icon-size defaults to 20px and can use relative units. The icon inherits text color from QDS tokens. Shared PrimeIcons CSS/font requests are cached; individual icons do not each create a stylesheet request. Custom SVG avoids font dependencies. Reconnection and dynamic name/label changes are supported.
Generated QdsIconComponent provides role graphics for Northwind review contacts at /#/admin/team, with decorative heading graphics and labelled responsibility icons. Existing generic avatars show fictional contact initials independently of authenticated-avatar behavior. Review contacts use native list/description-list semantics; see Shared Utilities.