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

@styloviz/stat-card

v1.0.2

Published

KPI metric cards with sparklines, trend chips and four layout variants.

Readme

@styloviz/stat-card

KPI metric cards with sparklines, trend chips and four layout variants.

Part of the Styloviz UI Kit — a premium Angular 21 & 22 + Tailwind CSS 4 dashboard component library. Standalone, OnPush, strongly typed, dark-mode ready.

Installation

npm install @styloviz/core @styloviz/icons @styloviz/sparkline @styloviz/stat-card

Requires @angular/core and @angular/common 21 or 22 (peer range >=21.0.0 <23.0.0). Also needs @styloviz/core, @styloviz/icons, @styloviz/sparkline — listed above so no extra step is required on npm (on pnpm/yarn, list them yourself). Prefer everything at once? @styloviz/all installs the whole free tier in one command.

Styles (required)

Styloviz components are Tailwind CSS 4 utilities. If the project does not use Tailwind yet, add it and its PostCSS plugin (the Angular CLI reads .postcssrc.json from the project root):

npm i -D tailwindcss @tailwindcss/postcss postcss
echo '{ "plugins": { "@tailwindcss/postcss": {} } }' > .postcssrc.json

Then, in your global stylesheet (usually src/styles.css), import the kit's tokens and let Tailwind scan the installed packages — it skips node_modules otherwise:

@import "tailwindcss";
@import "@styloviz/core/styles/styloviz.css";
@source "../node_modules/@styloviz";
@source "../node_modules/@styloviz-pro";   /* Pro only */

The stylesheet ships in @styloviz/core — add it to your install if it is not there already. Dark mode is class-based (class="dark" on <html>). Rebrand by redeclaring a token after the import: @theme { --color-primary-600: #0f766e; }.

Usage

import { SvStatCardComponent } from '@styloviz/stat-card';

@Component({
  standalone: true,
  imports: [SvStatCardComponent],
  template: `
    <sv-stat-card title="Revenue" [value]="48200" prefix="$" [trendPercent]="12.5" />
  `,
})
export class DemoComponent {}

Inputs

| Input | Type | Default | Description | | --- | --- | --- | --- | | title | string | '' | Card title / metric label. | | value | string \| number | '' | Primary metric value — string or number, displayed as-is or formatted. | | prefix | string | '' | Optional prefix rendered before the value (e.g. "$", "€"). | | suffix | string | '' | Optional suffix rendered after the value (e.g. "K", "%", "ms"). | | description | string | '' | Short helper text beneath the title (e.g. "Last 30 days"). | | trend | StatCardTrend | 'neutral' | Direction of change. | | trendValue | number \| null | null | Absolute delta value shown alongside the trend icon. | | trendPercent | number \| null | null | Percentage change shown in the trend chip. | | trendLabel | string | '' | Comparison context label (e.g. "vs last month"). | | updatedAt | string | '' | When this figure was last refreshed, as YYYY-MM-DD or an ISO timestamp. A CACHED KPI LOOKS IDENTICAL TO A LIVE ONE. A number is a number, and nothing about a stale one announces itself — so the reader assumes the dashboard is current, which is exactly the assumption a broken pipeline exploits. This is in the FREE tier deliberately. Telling a reader their figure may be out of date is an honesty feature, not a premium one, and a free card that hides staleness is the defect rather than a smaller version of it. | | staleAfterMinutes | number | 60 | How many minutes before the figure is called out as possibly stale. | | source | string | '' | Where the figure came from — a warehouse, a job, a service. | | variant | StatCardVariant | 'default' | Deprecated, and has no effect: the free card has one colour treatment. | | layout | StatCardLayout | 'default' | Card layout mode. | | icon | string | '' | Name of an icon in @styloviz/icons, e.g. 'trending-up'. This was iconPath — a raw <path d="…"> — with a companion iconViewBox because a pasted path might be 20-box or 24-box. Both are gone: a library name is always 24-box, and the viewBox binding is what hid these glyphs from check:ui in the first place (a bound viewBox does not match a literal viewBox="…" test). | | sparkline | SparkPoint[] | [] | Array of data points for the inline sparkline. Values should be on a consistent numeric scale; the component normalises them internally. Empty array hides the sparkline. | | loading | boolean | false | Show skeleton loading shimmer instead of content. | | error | SvDataError \| string \| null | null | The figure could not be loaded. Rendered in place of the metric, because a card that keeps showing a stale number after a failed refresh is worse than one that admits it: the reader has no way to tell the two apart. Use toSvDataError() from @styloviz/core to normalize an HttpErrorResponse. | | linkLabel | string | '' | Label for the bottom "view more" link. Empty string hides the link. | | customClass | string | '' | Additional CSS classes merged on the root card element. |

Outputs

| Output | Type | Description | | --- | --- | --- | | cardClick | void | Deprecated, and never emitted: the free card is not interactive. | | linkClick | void | Emitted when the "view more" link is clicked. | | retry | void | The host should re-run the failed load. |

Documentation

Full API reference and live demos: https://styloviz.dev/docs/stat-card

License

MIT