Staaarter

Rate Limit Dashboard

API rate-limit dashboard listing each endpoint's request quota for the current window, with a usage bar that shifts from green to amber to red as it approaches the limit and a reset countdown label. Perfect for an API status page or a developer-facing usage panel.

By Staaarter Team
DevTools
Docs
Live preview

Docs

Installation

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

npx shadcn add https://staaarter.com/r/rate-limit-dashboard.json

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

Usage

The file also exports devtools10Demo, 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 { Devtools10, devtools10Demo } from "@/components/blocks/devtools/devtools10";

export default function Page() {
  return <Devtools10 {...devtools10Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Rate limits"Section heading.
descriptionstring"Request quota usage per endpoint for the current window."Section intro text below the heading.
endpointsRateLimitEndpoint[]noneThe endpoints rendered as rows, in the order given.
classNamestringnoneExtra classes for the outer section element.

Types

type RateLimitEndpoint = {
  path: string;
  method: string;
  used: number;
  limit: number;
  resetLabel: string;
};

Behavior notes

  • The usage bar's fill percentage and color are both computed at render time from used / limit (a pure function of the fixed props you pass), not from any client-side state: under 70% is emerald, 70-89% is amber, 90%+ is red.
  • resetLabel is an opaque display string (e.g. "12m", "3m"); there is no live countdown timer, so it will not tick down on its own.
  • The rows have no links, sorting, or filtering; it is a static, read-only snapshot each time it renders.
  • method is shown as a plain badge-like label to the left of the path and accepts any string, so non-REST verbs or custom labels render fine too.