Gathering detailed insights and metrics for ngx-phosphor-icons
Gathering detailed insights and metrics for ngx-phosphor-icons
Gathering detailed insights and metrics for ngx-phosphor-icons
Gathering detailed insights and metrics for ngx-phosphor-icons
npm install ngx-phosphor-icons
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
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.
1npm install --save ngx-phosphor-icons
There are two ways of implementation, choose the one you like best.
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).
1import { AppComponent } from 'app/app.component'; 2... 3import { NgxPhosphorIconsModule } from 'ngx-phosphor-icons'; 4 5@NgModule({ 6 declarations: [ 7 AppComponent, 8 ], 9 imports: [ 10 NgxPhosphorIconsModule, // Phosphor Icon Pack 11 MatIconModule, // It is important to import the Icon material module. 12 ] 13 }) 14export class AppModule {}
You can choose the type of icon of your choice, if you only want to load the package.
Module | Weight | Example | View |
---|---|---|---|
NgxPhosphorIconsBoldModule | Bold | <mat-icon svgIcon="ph-bold:name_icon"></mat-icon> | ![]() |
NgxPhosphorIconsDuotoneModule | Duotone | <mat-icon svgIcon="ph-duotone:name_icon"></mat-icon> | ![]() |
NgxPhosphorIconsFillModule | Fill | <mat-icon svgIcon="ph-fill:name_icon"></mat-icon> | ![]() |
NgxPhosphorIconsLightModule | Light | <mat-icon svgIcon="ph-light:name_icon"></mat-icon> | ![]() |
NgxPhosphorIconsRegularModule | Regular | <mat-icon svgIcon="ph-regular:name_icon"></mat-icon> | ![]() |
NgxPhosphorIconsThinModule | Thin | <mat-icon svgIcon="ph-thin:name_icon"></mat-icon> | ![]() |
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
1"assets": [ 2 "src/assets", 3 ..., 4 { 5 "glob": "**/*", 6 "input": "node_modules/ngx-phosphor-icons/icons/", // Here 7 "output": "./assets/icons/" 8 } 9 ],
Module | Weight | Example |
---|---|---|
NgxPhosphorIconsBoldFileModule | All | node_modules/ngx-phosphor-icons/icons/ |
NgxPhosphorIconsBoldFileModule | Bold | node_modules/ngx-phosphor-icons/icons/phosphor-bold.svg |
NgxPhosphorIconsDuotoneFileModule | Duotone | node_modules/ngx-phosphor-icons/icons/phosphor-duotone.svg |
NgxPhosphorIconsLightFileModule | Fill | node_modules/ngx-phosphor-icons/icons/phosphor-light.svg |
NgxPhosphorIconsRegularFileModule | Regular | node_modules/ngx-phosphor-icons/icons/phosphor-regular.svg |
NgxPhosphorIconsFillFileModule | Fill | node_modules/ngx-phosphor-icons/icons/phosphor-fill.svg |
NgxPhosphorIconsThinFileModule | Thin | node_modules/ngx-phosphor-icons/icons/phosphor-thin.svg |
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
In the phosphoricons.com. documentation the icon calling is done as follows.
1<i class="ph-bold ph-graduation-cap"></i>
In this implementation the width type and icon name are called
1"ph-bold:graduation-cap"
You can use the icons in different ways, please read the @angular/Material documentation.
When the icon is purely cosmetic and conveys no real semantic meaning, the <mat-icon>
element is marked with aria-hidden="true"
.
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
.
1 2 // Icon 3 <mat-icon svgIcon="ph-bold:airplane"></mat-icon> 4 <mat-icon svgIcon="ph-duotone:airplane"></mat-icon> 5 <mat-icon svgIcon="ph-fill:airplane"></mat-icon> 6 <mat-icon svgIcon="ph-light:airplane"></mat-icon> 7 <mat-icon svgIcon="ph-regular:airplane"></mat-icon> 8 <mat-icon svgIcon="ph-thin:airplane"></mat-icon> 9 10 // Button 11 <button mat-icon-button color="warn" type="button"> 12 <mat-icon svgIcon="ph-bold:trash"></mat-icon> 13 </button> 14 ...
If you can help me I will appreciate it very much.
This project is licensed under the MIT License.
No vulnerabilities found.
No security vulnerabilities found.