Staaarter

Billing Developer API Quota

A technical billing block for developer and API-provider dashboards. Shows monthly request usage against the plan limit, when the window resets, a projected end-of-cycle total that flags plans likely to go over, and the current per-minute rate limit. Built with shadcn/ui Badge and Button components, Lucide icons, and Tailwind CSS.

By Staaarter Team
Billing
Updated June 21, 2026
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge, button dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/billing-developer-api-quota.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/billing/billing47.tsx instead.

Usage

The file also exports billing47Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Billing47, billing47Demo } from "@/components/blocks/billing/billing47";

export default function Page() {
  return <Billing47 {...billing47Demo} />;
}

Props

PropTypeDefaultDescription
titlestring"API quota"Block heading.
descriptionstringnoneSupporting text under the heading.
planNamestringnonePlan name shown as a badge in the top-right corner, omitted if not passed.
requestsUsednumbernoneRequests consumed so far in the current billing window.
requestsLimitnumbernoneTotal requests included in the current plan.
resetsInstringnoneHuman-readable time until the usage window resets, e.g. "9 days".
projectedTotalnumbernoneEstimated end-of-cycle request total, shown with a warning style when it exceeds requestsLimit.
rateLimitPerMinutenumbernonePer-minute request rate limit for the current plan.
rateLimitRemainingnumbernoneRequests remaining in the current rate-limit window, shown alongside rateLimitPerMinute when both are set.
manageLabelstring"Manage plan"Label on the footer link.
manageHrefstring"#"Destination for the footer link.
classNamestringnoneExtra classes for the outer container.

Behavior notes

  • All the numbers displayed are plain props, the component does no polling or fetching, it renders whatever snapshot you pass it.
  • The usage bar's percentage is clamped at 100% and switches to a destructive color exactly at the limit, so a plan sitting right at capacity still reads clearly.
  • The projected-total callout only renders when projectedTotal is passed, and its background switches to a warning style specifically when that value is greater than requestsLimit.
  • rateLimitRemaining is only shown when both it and rateLimitPerMinute are provided, passing just the per-minute limit renders that number alone without a remaining count.
  • planName, resetsIn, and description are each independently optional, so the block still renders a sensible minimal card with just usage numbers if none of them are passed.

Frequently asked questions