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

@deejayy/identicon-angular

v21.0.2

Published

An Angular (v21) library that generates deterministic, SVG avatars (identicons) from a GUID. The same GUID always produces the same face — a randomized head, glasses, eyes (with gaze), and mouth — over a contrast-checked color palette.

Readme

identicon-angular

An Angular (v21) library that generates deterministic, SVG avatars (identicons) from a GUID. The same GUID always produces the same face — a randomized head, glasses, eyes (with gaze), and mouth — over a contrast-checked color palette.

The generator is framework-agnostic at its core and exposed through a single standalone component.

Demo

Identicon demo

Features

  • Deterministic output — identical GUID yields an identical avatar
  • Pure SVG, no canvas or runtime image assets
  • Accessible contrast: palette is auto-tuned for legibility
  • Fully configurable geometry and color constants
  • Standalone component, ready for imports

Installation

npm install identicon-angular

Usage

Import the standalone component and bind a GUID:

import { Component } from '@angular/core';
import { IdenticonAngular } from 'identicon-angular';

@Component({
  selector: 'app-root',
  imports: [IdenticonAngular],
  template: `<app-identicon [guid]="userId" />`,
})
export class AppComponent {
  userId = 'd290f1ee-6c54-4b01-90e6-d701748f0851';
}

With configuration

Every generation constant can be overridden through the optional config input. Any omitted field falls back to its default.

<app-identicon
  [guid]="userId"
  [config]="{
    size: 96,
    syncedProbability: 0.5,
    palette: { minBackgroundContrast: 2.0, hueRange: { min: 0, max: 360 } }
  }"
/>

Inputs

| Input | Type | Required | Description | | -------- | ------------------ | -------- | -------------------------------------------------- | | guid | string | yes | Seed for the deterministic RNG. | | config | IdenticonConfig | no | Overrides for size, geometry, and palette tuning. |

IdenticonConfig

| Field | Type | Default | Description | | ------------------- | -------------------------- | ---------------------------- | ------------------------------------------------------ | | size | number | 128 | Rendered pixel width/height of the SVG. | | head | { cx, cy, r } | { 50, 46, 35 } | Head geometry within the 100×100 viewBox. | | glasses | { cx, cy, r } | { 50, 37, 10 } | Glasses geometry. | | mouth | { cx, cy, w } | { 50, 65, 13 } | Mouth geometry. | | syncedProbability | number | 0.7 | Probability both eyes share the same gaze direction. | | gazeTravelFactor | number | 0.32 | Pupil travel as a fraction of the glasses radius. | | palette | IdenticonPaletteConfig | see below | Color/contrast tuning. |

IdenticonPaletteConfig

| Field | Type | Default | Description | | ------------------------ | ------------------ | -------------------- | ---------------------------------------------------- | | minBackgroundContrast | number | 1.85 | Minimum contrast ratio between background and head. | | minPairContrast | number | 1.38 | Minimum contrast ratio between adjacent feature pairs.| | hueRange | { min, max } | { 35, 320 } | Allowed hue band (default avoids reds). | | maxAttempts | number | 40 | Attempts to find a passing palette before keeping the best. |

Framework-agnostic API

The underlying generator is exported for non-component use (SSR, image pipelines, tests):

import { generateAvatar } from 'identicon-angular';

const svgMarkup: string = generateAvatar('some-guid', { size: 64 });

Also exported: createPalette, createRng, resolveConfig, DEFAULT_IDENTICON_CONFIG, and the related types (IdenticonConfig, IdenticonPaletteConfig, ResolvedIdenticonConfig, Palette, Rng).

Development

npm run build   # build the library to dist/
npm test        # run unit tests (Vitest)

License

MIT