npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

custom-svg-icons

v0.1.2

Published

A custom collection of icons you define for use in an Angular project using Material.

Downloads

2

Readme

Custom SVG Icons

This is a collection of icons you define in the icons.defs.svg file for use in an Angular project using Material.

The icons.defs.svg (that contains all your icons) must be located in your assets folder.

To create custom icons from an SVG please refer to Creating an Icon Set

Installation

npm install custom-svg-icons

Usage

Import the Module into the module that you need the icons - if you wish, you can import at the app level for global usage.

CustomSVGIconsModule

Here is a sample of the import

@NgModule({
  declarations: [
    AppComponent,
  ],
  imports: [
    MaterialModule,
    BrowserModule,
    AppRoutingModule,
    BrowserAnimationsModule,
    ...
    CustomSVGIconsModule,
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Once imported use the following syntax for the icon

<mat-icon svgIcon="icon-book-solid"></mat-icon>

Creating or Adding to an Icon Set

Here is a service you can use to manage icons sets. This is not nessessary if you understand the strcture of the icons-defs.svg file, which is simply a list of SVG files

Here is what the file structure looks like. You add your SVG files between the <defs></defs> tags

<svg aria-hidden="true" style="position: absolute; width: 0; height: 0; overflow: hidden;" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">

  <defs>

    <symbol id="icon-file-arrow-up-solid" viewBox="0 0 24 32">
    <path d="M16 0v8h8l-8-8zM14 8v-8h-11c-1.657 0-3 1.343-3 3v26c0 1.656 1.343 3 3 3h18c1.657 0 3-1.343 3-3v-19h-7.944c-1.162 0-2.056-0.894-2.056-2zM18.006 21.506c-0.238 0.35-0.619 0.494-1.006 0.494s-0.767-0.146-1.061-0.439l-2.439-2.442v6.381c0 0.828-0.672 1.5-1.5 1.5s-1.5-0.672-1.5-1.5v-6.381l-2.439 2.439c-0.586 0.586-1.535 0.586-2.121 0s-0.586-1.535 0-2.121l5-5c0.586-0.586 1.535-0.586 2.121 0l5 5c0.583 0.588 0.583 1.538-0.054 2.069z"></path>
    </symbol>

  </defs>

</svg>

Now you can use any declared icon in your symbol-def.svg throughout your app. Notice that all the icon names are prefixed with “icon-” so if you named something “pen” on the IcoMoon interface, it is now accessible with the name “icon-pen”.

<mat-icon svgIcon="icon-pen"></mat-icon>

Online Icon Tool

There is a tool you can use that does the same thing. The tool also allows you to get icons from other well known icon sets such as FavIcons and Others. You can merge these icons togther to form you own custom set.

  • Goto https://icomoon.io and create an icon set and download the file

  • Copy the icons.defs.svg file into the assets folder