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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@blazon/ngx

v0.1.0

Published

Angular adapter for the Blazon heraldry registry

Readme

@blazon/ngx

Angular 16+ adapter for the Blazon heraldry registry. Provides provideBlazonIcons() and the standalone <blazon-icon> component.

Requirements

  • Angular ≥ 16
  • @blazon/core ≥ 0.1.0

Install

pnpm add @blazon/ngx @blazon/core @blazon/country-poland @blazon/types

Setup

Option 1 — Tree-shakeable static imports (recommended for known icons)

Import only the cities you need. Everything else is tree-shaken out of the bundle:

// app.config.ts
import { ApplicationConfig } from '@angular/core';
import { warszawa, krakow, wroclaw } from '@blazon/country-poland';
import { provideBlazonIcons } from '@blazon/ngx';

export const appConfig: ApplicationConfig = {
  providers: [provideBlazonIcons([warszawa, krakow, wroclaw])],
};

Option 2 — Lazy HTTP loader (for large or dynamic collections)

// app.config.ts
import { ApplicationConfig } from '@angular/core';
import { provideBlazonIcons } from '@blazon/ngx';

export const appConfig: ApplicationConfig = {
  providers: [
    provideBlazonIcons({
      // Lazy loaders — invoked at most once per country
      loaders: {
        PL: () => fetch('/registries/pl.json').then((r) => r.json()),
        DE: () => import('./registries/de').then((m) => m.default),
      },
      // Eagerly pre-load on bootstrap (optional)
      preload: ['PL'],
      // SVG shown when an ID is not found (optional)
      fallbackSvg: '<svg>...</svg>',
    }),
  ],
};

<blazon-icon> Component

import { BlazonIcon } from '@blazon/ngx';

@Component({
  imports: [BlazonIcon],
  template: `
    <!-- Basic usage -->
    <blazon-icon id="pl-city-warszawa" />

    <!-- With explicit size and accessible label -->
    <blazon-icon id="pl-city-warszawa" [size]="64" alt="Warsaw coat of arms" />

    <!-- CSS custom property for responsive sizing -->
    <blazon-icon id="pl-city-warszawa" style="--blazon-size: 3rem" />
  `,
})
export class MyComponent {}

Inputs

| Input | Type | Required | Description | | ------ | -------- | -------- | ---------------------------------------------------------------- | | id | string | ✅ | Registry ID, e.g. "pl-city-warszawa" | | alt | string | — | Accessible label (aria-label). Defaults to the entry's name. | | size | number | — | Pixel size applied to width and height. |

BlazonIconsService

Access the service directly for programmatic use:

import { inject } from '@angular/core';
import { BlazonIconsService } from '@blazon/ngx';

@Injectable()
export class MyService {
  private readonly blazon = inject(BlazonIconsService);

  async getWarsaw() {
    return this.blazon.resolve('pl-city-warsaw');
  }
}

Architecture notes

  • BlazonIconsService is a thin Angular wrapper — no business logic
  • All registry logic lives in @blazon/core
  • The component uses ChangeDetectionStrategy.OnPush and Angular signals
  • SVG content is sanitized via Angular's DomSanitizer before rendering