Introducing shieldcn — README badges, shadcn style.

Check it out

npm Badge

Live npm package badge showing version, weekly downloads, license, and last publish date.

class-variance-authority
Loading...

Installation

$ shadcn add @jalco/npm-badge

Usage

import { NpmBadge } from "@/components/npm-badge"
<NpmBadge package="react" />

Layouts

Inline

Compact pill showing the npm icon and version. The default layout.

Default

With downloads

npm icon

Row

Segmented horizontal strip showing package name, version, downloads, and license.

Row layout

reactv19.2.6129.1M/wkMIT

Card

Feature card showing package details, readme summary, and publish info.

API Reference

NpmBadge

PropType

Notes

  • ISR caching. Registry and download data are cached for 1 hour via next.revalidate . No API key required.
  • Pre-fetched data. Pass the data prop to skip the API calls entirely — useful for static builds or when fetching data separately.
  • Scoped packages. Supports scoped names like @tanstack/react-query .