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

ng-hub-ui-metrics

v22.1.0

Published

Read-only value visualizations (progress, meter, gauge/ring) for Angular 21+, part of the ng-hub-ui family.

Readme

ng-hub-ui-metrics

Español | English

NPM Version Angular License

Read-only value visualizations for Angular 21+ — a linear progress bar, a graded meter gauge and a circular ring (gauge) — bundled into a single standalone, signal-driven library. Zero external dependencies; every colour and dimension is a --hub-* CSS custom property derived from the shared design-system tokens.

Documentation and Live Examples

This package is part of Hub UI, a collection of Angular component libraries for standalone apps.

  • Docs: https://hubui.dev/metrics/overview/
  • Live examples: https://hubui.dev/metrics/examples/
  • Hub UI: https://hubui.dev/

🧩 Library Family ng-hub-ui

This library is part of the ng-hub-ui ecosystem:


🚀 Quick Start

1. Install

npm install ng-hub-ui-metrics

Theming (recommended): install the shared design tokens so the metrics — and every other ng-hub-ui library — read the same palette and dark-mode colours:

npm install ng-hub-ui-ds
@import 'ng-hub-ui-ds/styles/tokens/hub-tokens.css';

It is an optional peer dependency: every component ships sensible CSS fallbacks and works without it.

2. Import the standalone components

import { HubProgressComponent, HubMeterComponent, HubRingComponent } from 'ng-hub-ui-metrics';

@Component({
    standalone: true,
    imports: [HubProgressComponent, HubMeterComponent, HubRingComponent],
    template: `
        <hub-progress [value]="72" label="Upload" [showValue]="true" color="info" />

        <hub-meter [value]="0.82" [low]="0.3" [high]="0.7" [optimum]="0.9" />

        <hub-ring [value]="0.86" [thresholds]="{ low: 0.4, high: 0.75 }">Score</hub-ring>
    `
})
export class DashboardComponent {}

📦 Description

ng-hub-ui-metrics closes a common gap in product dashboards: read-only value visualizations that every app otherwise hand-rolls. The three primitives cover the recurring shapes — a linear bar, a graded gauge and a circular ring — with a consistent, token-driven look and a correct ARIA contract, so you pay the ceremony once.

🎯 Components

<hub-progress> — linear bar

A determinate or indeterminate progress bar. Host role progressbar.

| Input | Type | Default | Description | |---|---|---|---| | value | number | 0 | Current value on the [0, max] scale. | | max | number | 100 | Upper bound of the scale. | | indeterminate | boolean | false | Loops the bar and drops aria-valuenow. | | color | HubMetricsColor \| undefined | undefined | Optional semantic accent (primary, success, neutral, …); applied inline when set. Omit to let a theme (mixin / token override) drive the accent — it defaults to primary. | | size | 'sm' \| 'md' \| 'lg' | 'md' | Bar thickness. | | showValue | boolean | false | Render the rounded percentage. | | label | string | '' | Accessible label (aria-label) and leading caption. |

<hub-meter> — graded gauge

A gauge following HTML <meter> semantics; the fill colour reflects the band the value falls in. Host role meter.

| Input | Type | Default | Description | |---|---|---|---| | value | number | 0 | Current measurement. | | min | number | 0 | Lower bound of the scale. | | max | number | 1 | Upper bound of the scale. | | low | number \| undefined | undefined | Upper limit of the "low" region (defaults to min). | | high | number \| undefined | undefined | Lower limit of the "high" region (defaults to max). | | optimum | number \| undefined | undefined | Preferred point (defaults to the midpoint). |

The computed band is exposed as data-band (low / optimum / high) and maps to --hub-meter-low-bg / --hub-meter-optimum-bg / --hub-meter-high-bg.

<hub-ring> — circular gauge (alias hubGauge)

A normalized score drawn as an SVG arc, with an optional centre caption projected via <ng-content>. Host role meter.

| Input | Type | Default | Description | |---|---|---|---| | value | number | 0 | Score as a 0..1 ratio or a 0..max figure. | | max | number | 1 | Value is normalized against this. | | size | number \| string | '4rem' | Outer diameter (number → px). | | thickness | number \| string | '0.5rem' | Stroke width (number → px). | | thresholds | { low?: number; high?: number } | undefined | Recolours the arc by band. | | showValue | boolean | true | Render the rounded percentage in the centre. |


🎨 Styling

Every visual detail is a --hub-* CSS custom property. Each component declares its defaults on its own element (:where(.hub-progress) / :where(.hub-meter) / :where(.hub-ring)), so a value set on the element wins over one inherited from a bare ancestor. Set the tokens on the component element, or on a wrapper that targets the components as descendants (.wrapper :where(.hub-ring) { … }) — which is exactly what the hub-metrics-theme() mixin emits. For <hub-progress> prefer the per-instance color input for one-off semantic tints.

hub-progress

| Token | Default | Description | |---|---|---| | --hub-progress-track-bg | tint of the accent | Track background. | | --hub-progress-indicator-bg | --hub-progress-accent | Filled indicator colour. | | --hub-progress-height | 0.5rem | Bar thickness. | | --hub-progress-radius | 50rem | Corner radius. |

hub-meter

| Token | Default | Description | |---|---|---| | --hub-meter-track-bg | subtle neutral | Track background. | | --hub-meter-low-bg | --hub-sys-color-danger | "Below target" fill. | | --hub-meter-optimum-bg | --hub-sys-color-success | "On target" fill. | | --hub-meter-high-bg | --hub-sys-color-warning | "Above target" fill. | | --hub-meter-height | 0.5rem | Bar thickness. | | --hub-meter-radius | 50rem | Corner radius. |

hub-ring

| Token | Default | Description | |---|---|---| | --hub-ring-size | 4rem | Outer diameter. | | --hub-ring-thickness | 0.5rem | Stroke width. | | --hub-ring-track | subtle neutral | Track (unfilled) stroke. | | --hub-ring-indicator | --hub-sys-color-primary | Indicator stroke. | | --hub-ring-caption-color | --hub-sys-text-primary | Centre caption colour. | | --hub-ring-low-color | --hub-sys-color-danger | Stroke below the low threshold. | | --hub-ring-high-color | --hub-sys-color-success | Stroke at/above the high threshold. |

One-call Sass theming

@use 'ng-hub-ui-metrics/styles' as hub;

.app-dashboard {
    @include hub.hub-metrics-theme($accent: var(--hub-sys-color-info), $radius: 0.25rem);
}

📄 License

MIT © Carlos Morcillo