@devigner-ui/icons-angular: one standalone component, DvIcon, and every
icon as a small data export. The artwork is rendered from the React package
at build time, so the two cannot drift.
npm install @devigner-ui/icons-angularAngular 16 or newer. The component ships partially compiled, the format the Angular CLI links at build time, and renders on the server.
DvIcon goes on your own <svg>:
import { Component } from "@angular/core";
import { DvIcon, IconAdd, IconShoppingCart } from "@devigner-ui/icons-angular";
@Component({
selector: "app-cart",
standalone: true,
imports: [DvIcon],
template: `
<svg [dvIcon]="IconAdd" class="size-6"></svg>
<svg [dvIcon]="IconShoppingCart" variant="bulk" class="size-6 text-violet-600"></svg>
`,
})
export class CartComponent {
IconAdd = IconAdd;
IconShoppingCart = IconShoppingCart;
}Classes and attributes stay on the element that draws, with no wrapper in the
layout. Each Icon* export is its own module, so a build keeps only the
icons your components reference.
| Input | Type | Default | What it does |
|---|---|---|---|
dvIcon |
IconData |
required | The icon: any Icon* export |
variant |
"outline" | "twotone" | "bold" | "bulk" | "broken" |
"outline" |
Which drawing to render |
strokeWidth |
string | number |
1.5 |
Line weight of outline, twotone and broken |
An icon renders aria-hidden="true" by default, because an icon beside its
own label would be read out twice. Name it and it becomes an image:
<svg [dvIcon]="IconAdd" aria-label="Add item"></svg>