Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

ngx-phosphor-icons

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-phosphor-icons

A flexible icon family for interfaces, diagrams, presentations — whatever, really.

latest
npmnpm
Version
1.0.7
Version published
Weekly downloads
169
12.67%
Maintainers
1
Weekly downloads
 
Created
Source

ngx-phosphor-icons

Phosphor is a flexible icon family for interfaces, diagrams, presentations, buttons — whatever, really. Explore all our icons at phosphoricons.com.

ngx-phosphor-icons It is designed to be used together with @angular/Material since it seeks to integrate the Phosphor icons into @angular/material/icon, allowing it to be used in an easy and orderly way.

  • 1,512 icons and counting
  • 6 weights: Thin, Light, Regular, Bold, Fill, and Duotone
  • Raw stroke information retained to fine-tune the style

Installation

npm install --save ngx-phosphor-icons

Imports

There are two ways of implementation, choose the one you like best.

Module Import (Option 1)

Simply import the NgxPhosphorIconsModule into the AppModule so that the entire project can use the icons, or into the module you require. (This module has all types of icons).

import { AppComponent } from 'app/app.component';
...
import { NgxPhosphorIconsModule } from 'ngx-phosphor-icons';

@NgModule({
    declarations: [
      AppComponent,
    ],
    imports: [
      NgxPhosphorIconsModule, // Phosphor Icon Pack
      MatIconModule, // It is important to import the Icon material module.
    ]
  })
export class AppModule {}

Other Modules (Optional).

You can choose the type of icon of your choice, if you only want to load the package.

ModuleWeightExampleView
NgxPhosphorIconsBoldModuleBold<mat-icon svgIcon="ph-bold:name_icon"></mat-icon>
NgxPhosphorIconsDuotoneModuleDuotone<mat-icon svgIcon="ph-duotone:name_icon"></mat-icon>
NgxPhosphorIconsFillModuleFill<mat-icon svgIcon="ph-fill:name_icon"></mat-icon>
NgxPhosphorIconsLightModuleLight<mat-icon svgIcon="ph-light:name_icon"></mat-icon>
NgxPhosphorIconsRegularModuleRegular<mat-icon svgIcon="ph-regular:name_icon"></mat-icon>
NgxPhosphorIconsThinModuleThin<mat-icon svgIcon="ph-thin:name_icon"></mat-icon>

Module File Import (Option 2)

This form of import has the same characteristics, only that the file is consulted when starting the angular.json. The Modules Change Name and include the "File" Label

In the "input" path: You can specify only one import file if you want or leave it like this to import everything

"assets": [
      "src/assets",
      ...,
      {
          "glob": "**/*",
          "input": "node_modules/ngx-phosphor-icons/icons/", // Here
          "output": "./assets/icons/"
      }
  ],

Module File List

ModuleWeightExample
NgxPhosphorIconsFileModuleAllnode_modules/ngx-phosphor-icons/icons/
NgxPhosphorIconsBoldFileModuleBoldnode_modules/ngx-phosphor-icons/icons/phosphor-bold.svg
NgxPhosphorIconsDuotoneFileModuleDuotonenode_modules/ngx-phosphor-icons/icons/phosphor-duotone.svg
NgxPhosphorIconsLightFileModuleFillnode_modules/ngx-phosphor-icons/icons/phosphor-light.svg
NgxPhosphorIconsRegularFileModuleRegularnode_modules/ngx-phosphor-icons/icons/phosphor-regular.svg
NgxPhosphorIconsFillFileModuleFillnode_modules/ngx-phosphor-icons/icons/phosphor-fill.svg
NgxPhosphorIconsThinFileModuleThinnode_modules/ngx-phosphor-icons/icons/phosphor-thin.svg

Props

Icon components accept all props that you can pass to a normal SVG element, including inline style objects, click handlers, and more.

The properties are defined by Angular and @angular/material/icon

Usage

In the phosphoricons.com. documentation the icon calling is done as follows.

<i class="ph-bold ph-graduation-cap"></i>

In this implementation the width type and icon name are called

<mat-icon svgIcon="ph-bold:graduation-cap"></mat-icon>

You can use the icons in different ways, please read the @angular/Material documentation.

Decorative icons

When the icon is purely cosmetic and conveys no real semantic meaning, the <mat-icon> element is marked with aria-hidden="true".

Interactive icons

Icons alone are not interactive elements for screen-reader users; when the user would interact with some icon on the page, a more appropriate element should "own" the interaction:

The <mat-icon> element should be a child of a <button> or <a> element. The parent <button> or <a> should either have a meaningful label provided either through direct text content, aria-label, or aria-labelledby.

Example


  // Icon
  <mat-icon svgIcon="ph-bold:airplane"></mat-icon>
  <mat-icon svgIcon="ph-duotone:airplane"></mat-icon>
  <mat-icon svgIcon="ph-fill:airplane"></mat-icon>
  <mat-icon svgIcon="ph-light:airplane"></mat-icon>
  <mat-icon svgIcon="ph-regular:airplane"></mat-icon>
  <mat-icon svgIcon="ph-thin:airplane"></mat-icon>

  // Button
  <button  mat-icon-button color="warn" type="button">
    <mat-icon svgIcon="ph-bold:trash"></mat-icon>
  </button>
  ...

Donate

If you can help me I will appreciate it very much.

Buy Me A Coffee

Community Projects

LICENSE

This project is licensed under the MIT License.

Keywords

icons

FAQs

Package last updated on 23 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts