@i316/phosphor-angular
v0.1.1
Published
i316: Phosphor icons for Angular (standalone directive, tree-shakeable icon data).
Maintainers
Readme
@i316/phosphor-angular
i316: Phosphor icons for Angular 17+. 1,512 icons in 6 styles: thin, light, regular (default), bold, fill, duotone.
Other i316 Phosphor packages: @i316/phosphor-react (React web), @i316/phosphor-react-native (React Native), @i316/phosphor-vue (Vue 3) and @i316/phosphor-web (plain HTML web component and raw SVGs).
npm install @i316/phosphor-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 { PhosphorIcon, CaretDownRegular, BellBold } from '@i316/phosphor-angular';
@Component({
selector: 'app-toolbar',
standalone: true,
imports: [PhosphorIcon],
template: `
<svg phosphorIcon [icon]="caretDown" [size]="20" color="#e11d48"></svg>
<svg phosphorIcon [icon]="bell" title="Notifications"></svg>
`,
})
export class Toolbar {
caretDown = CaretDownRegular;
bell = BellBold;
}Icon data is exported from the root as <Name><Style> (CaretDownRegular), or per style as <Name> (import { CaretDown } from '@i316/phosphor-angular/regular'). Each icon is its own module, so production builds ship only the icons you reference. Switch styles by binding a different constant.
Defaults
import { providePhosphorIcons } from '@i316/phosphor-angular';
bootstrapApplication(App, { providers: [providePhosphorIcons({ size: 20 })] });
// or, for one component subtree: @Component({ providers: [providePhosphorIcons({ 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 |
| secondaryColor | color | color of the translucent layer, duotone only |
| secondaryOpacity | as designed | opacity of that layer, duotone only |
| 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 phosphor-icon phosphor-icon-<name>, plus any class you set on the <svg>.
Works with Angular SSR. Peer dependency: @angular/core >= 17.
License
Icons: Phosphor Icons (https://github.com/phosphor-icons/core), licensed under MIT. i316 modified them: reformatted and grouped into folders by each icon's primary upstream category; 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.
