Installation
Use the shadcn CLI to copy the component source and its dependencies into your own project. Only the Minimal world, with motion, plus the Ovio theme, world, motion, keys, format items.
npx shadcn add JanaSundar/ovio/npm-downloads-minimalUsage
Set the visual world on the component, or wrap the page in an OvioProvider to set a default for everything inside it.
import { NpmDownloads } from "@/components/ovio/npm-downloads/npm-downloads"
<NpmDownloads
variant="minimal"
packageName="lumen"
data={downloads}
/>Built with: CSS · SVG · Motion for React
Motion in Minimal: Small springs, opacity and layout shifts that show state.
Data
Fetch it on the server with getWeeklyDownloads(packageName, weeks) and pass the result as props. The helper is lib/npm.ts, added with the CLI.
npx shadcn add JanaSundar/ovio/npm| Source | The npm registry's downloads API, summed into Monday-to-Sunday weeks. The current, partial week is left out. |
| Auth | None. |
| Limits | One request per refresh. npm serves up to 18 months, about 78 weeks. |
| Caching | Cached for an hour by default (revalidate: 3600), so traffic adds no API calls. A failed refresh keeps serving the last good data, and a spent limit throws RateLimitError with the time it resets. |
| This demo | Live data from hono, through the same helper. If the API fails, the sample shows instead. |
Readme embed
The same component as an image for a GitHub README, drawn in the world picked above and refreshed every hour. No install, no token: paste the Markdown.
[](https://www.npmjs.com/package/hono)Props
Control the data, selected world, animation behavior, and callbacks.
| Prop | Type | Description |
|---|---|---|
| packageName | string | npm package name. |
| data | { week: string; downloads: number }[] | Weekly history, oldest first. |
| variantdefault minimal | minimalcraftretrotoy | Which world to render. Uses the nearest OvioProvider when there is one. |
| weeksdefault 12 | number | Latest weeks shown. |
| goal | number | Weekly target. Hidden when left out. |
| className | string | Merged onto the root. |