Icon
A generic inline icon renderer that renders from either a slotted SVG or an SVG path d string attribute, using currentColor stroke so color follows CSS.
Preview
Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
path | string | — | SVG path d string to render as an inline icon |
d | string | — | Alias for path: SVG path d string to render |
size | string | 1.25rem | Width and height of the icon |
stroke-width | number | 2 | SVG stroke width |
label | string | — | Accessible aria-label; when absent the icon is aria-hidden |
Installation
pura is copy-paste and dependency-free. Load the whole library, or just this component.
<link rel="stylesheet" href="/pura/tokens.css">
<script type="module" src="/pura/lib/icon.js"></script> import "./pura/lib/icon.js";