@i316/heroicons-angular
v0.1.1
Published
i316: Heroicons icons for Angular (standalone directive, tree-shakeable icon data).
Maintainers
Readme
@i316/heroicons-angular
i316: Heroicons icons for Angular 17+. 324 icons in 2 styles: outline (default), solid.
Other i316 Heroicons packages: @i316/heroicons-react (React web), @i316/heroicons-react-native (React Native), @i316/heroicons-vue (Vue 3) and @i316/heroicons-web (plain HTML web component and raw SVGs).
npm install @i316/heroicons-angularThis installs @i316/angular too: one small standalone directive that renders every i316 collection. This package itself is plain icon data.
Usage
import { Component } from '@angular/core';
import { HeroIcon, ChevronDownOutline, BellSolid } from '@i316/heroicons-angular';
@Component({
selector: 'app-toolbar',
standalone: true,
imports: [HeroIcon],
template: `
<svg heroIcon [icon]="chevronDown" [size]="20" color="#e11d48"></svg>
<svg heroIcon [icon]="bell" title="Notifications"></svg>
`,
})
export class Toolbar {
chevronDown = ChevronDownOutline;
bell = BellSolid;
}Icon data is exported from the root as <Name><Style> (ChevronDownOutline), or per style as <Name> (import { ChevronDown } from '@i316/heroicons-angular/outline'). Each icon is its own module, so production builds ship only the icons you reference. Switch styles by binding a different constant.
Defaults
import { provideHeroIcons } from '@i316/heroicons-angular';
bootstrapApplication(App, { providers: [provideHeroIcons({ size: 20, strokeWidth: 2 })] });
// or, for one component subtree: @Component({ providers: [provideHeroIcons({ color: 'slategray' })] })Inputs on an icon override the defaults. Nested providers merge over their parent's values.
Inputs
| Input | Default | |
|---|---|---|
| size | 24 | width and height |
| color | currentColor | icon color |
| strokeWidth | 1.5 | outline only; ignored by the other styles |
| title | none | accessible name (see below) |
| icon | required | the icon data constant |
Accessibility: icons are decorative by default (aria-hidden="true"). Set title to make one meaningful: it renders a <title> and role="img". Your own aria-label or role also removes aria-hidden.
Styling: every icon has the classes hero-icon hero-icon-<name>, plus any class you set on the <svg>.
Works with Angular SSR. Peer dependency: @angular/core >= 17.
License
Icons: Heroicons by Tailwind Labs (https://github.com/tailwindlabs/heroicons), licensed under MIT. i316 modified them: 24px outline and solid sets only, recolored to currentColor and reformatted; converted into React, React Native, Vue, Angular and web-component formats.
i316 code (components, runtime, tooling): MIT, © 2026 rahil316. See LICENSE for both licenses in full.
