@iconoven/angular
v1.0.1
Published
Angular standalone component for IconOven Icons: 85,000+ icons in 13 styles, with an opt-in motion entry.
Readme
@iconoven/angular
An Angular standalone component for IconOven Icons: 85,000+ icons across 13 styles, with round or sharp corners and 13 optional motions.
Install
npm install @iconoven/angularNeeds Angular 19 or later. Works with zoneless apps and server rendering.
Usage
Put ioIcon on an <svg> and pass the icon data. Every icon's data is exported in camelCase (home) and PascalCase (Home).
import { Component } from '@angular/core'
import { IconComponent, home, Camera } from '@iconoven/angular'
@Component({
selector: 'app-toolbar',
imports: [IconComponent],
template: `
<svg ioIcon [icon]="home"></svg>
<svg ioIcon [icon]="Camera" size="32" variant="twotone" title="Take a photo"></svg>
`,
})
export class ToolbarComponent {
home = home
Camera = Camera
}Inputs
| Input | Type | Default | Notes |
| --- | --- | --- | --- |
| icon | IconMaster | | Icon data such as home. |
| name | string | | Icon name such as "camera". Needs the dynamic entry (below). |
| variant | one of the 12 styles | 'stroke' | stroke is free. The other 11 are IconOven Pro (see below). |
| size | number \| string | 24 | Sets width and height. |
| strokeWidth | 1 \| 1.5 \| 2 | 1.5 | Dots and other widths scale with it. |
| corners | 'rounded' \| 'sharp' | 'rounded' | Sharp gives square corners and stroke ends. |
| color | string | currentColor | Primary colour (--icon-primary). Stroke and Solid follow it as color. |
| secondary | string | | Secondary colour (--icon-secondary) for two-colour styles. |
| title | string | | Accessible name: adds role="img" and a <title>. Without it the icon is aria-hidden. |
| motion | one of the 13 motions | | Needs import '@iconoven/angular/motion' once. |
| trigger | 'mount' \| 'hover' \| 'click' \| 'in-view' \| 'loop' | 'mount' | When the motion plays. |
Your own class and style stay on the <svg>. Every icon has the classes ico ico-<name>, and ico-m ico-m-<motion> when it moves. Colours are CSS variables: --icon-primary, --icon-secondary, --icon-primary-tint, --icon-secondary-tint and --icon-ink.
Defaults
provideIconDefaults() sets defaults for every icon in an injector: the app config, a route, or a component's providers. Nested providers merge, and inputs on an icon always win.
import { provideIconDefaults } from '@iconoven/angular'
bootstrapApplication(AppComponent, {
providers: [provideIconDefaults({ variant: 'twotone', size: 20, colors: { primary: '#0F766E', secondary: '#16C0B4' } })],
})Icons by name
Import IconComponent from @iconoven/angular/dynamic to use name. This loads every icon, so use data imports when you can.
import { IconComponent, iconNames } from '@iconoven/angular/dynamic'
@Component({ imports: [IconComponent], template: `<svg ioIcon name="camera"></svg>` })iconNames lists every icon name.
Motion
Import the motion entry once, then set motion and trigger on any icon. Apps that never import it carry no motion code.
import { IconSwapComponent } from '@iconoven/angular/motion'
@Component({
imports: [IconComponent, IconSwapComponent],
template: `
<svg ioIcon [icon]="bell" motion="wiggle" trigger="hover"></svg>
<button (click)="playing = !playing">
<io-icon-swap [from]="play" [to]="pause" [active]="playing" />
</button>
`,
})io-icon-swap plays the Replace motion: the old icon undraws and the new one draws in.
Free and Pro
The Stroke style of every icon is free under the MIT licence. The other 12 styles (Tinted, Gradient, Duotone, Twotone, Solid, Bulk, Solid Twotone, Solid Gradient, Line Duo, Hybrid, Color Outline and Pop) are IconOven Pro and are covered by the IconOven Pro licence. You reach all but Pop through variant; Pop is ready SVG in @iconoven-pro/icons/pop. Get Pro at https://iconoven.com/icons/pro.
Licence
Code and the Stroke style: MIT. Pro styles: IconOven Pro licence.
