shadcn blocks for usage, costs and budgets.

Copy usage, cost and budget blocks into your app for Radix or Base UI, or take the headless React hooks and keep your own design. Every block reads exact figures from the Meter.

The React layer and registry run from the repository checkout, not npm.

Try them live.

These previews read an in-memory Meter in your browser. Send a request or simulate a timeout, and every number moves.

In-memory sample data

header-status

Demo workspaceWithin budget: $6.88 left of $25.00

Within budget

Resets Nov 1

Alert at 80%

usage-summary-cards

Requests

11

Measured

Provider cost

$18.12

Measured

Unknown operations

0

None awaiting evidence

budget-card

Monthly spend

Resets Nov 1

Within budget
Used
$18.12
Reserved
$0.00
Remaining
$6.88
Limit
$25.00

Blocks at the limit. Alert at 80%.

cost-summary-card

Provider cost

Provider charges for tracked usage.

Measured

$18.12

  • Own key$5.63Cost owner demo-workspace5 requests
  • Platform funded$12.49Cost owner platform6 requests

coverage-summary

Coverage

October 2026

  • Metered1168.75%
  • Cached318.75%
  • Passthrough16.25%
  • Rate limited16.25%
  • Unpriced00%

Total16 requests

Cost excludes untracked requests.

usage-table

Usage detail

October 2026

Usage by provider, October 2026
ProviderFundingRequestsTokensCostCertainty
Language modelPlatform funded612,490$12.49Estimated
Search APIOwn key5Unavailable$5.63Measured

As of on the sample clock.

exceptions-list

Needs attention

October 2026

Operations that need attention, October 2026
OperationProviderPrincipalExceptionStateAge
No exceptions in this period.

Together they make a shadcn dashboard for usage and costs. See all 20 blocks in the component index.

Or take only the hooks.

Headless hooks return exact view models with explicit states. Equal reads share one cache, so a header badge and a dashboard never disagree.

spend-budget.tsx
import { useBudgetsView } from "@usagekit/react";
import type { Scope } from "@usagekit/core";
// Bar, Money and Notice are your own components.

type Props = { scope: Scope };

export function SpendBudget({ scope }: Props) {
  // Equal reads share one cache entry.
  const { data, state, refresh } = useBudgetsView({
    scope,
    surface: "app",
    units: ["cents"],
  });

  if (state === "loading") return <Notice busy />;
  if (state !== "ok" || !data) return (
    <Notice state={state} onRetry={refresh} />
  );

  return data.rows.map((row) => (
    <section key={row.id} data-level={row.level}>
      <Money amount={row.remaining} /> left
      <Bar geometry={row.bar} />
    </section>
  ));
}

What your component receives

The live output of useBudgetsView on this page, read from the sample in-memory Meter.

// data.rows[0]
{
used: { text: "1812", unit: "cents", certainty: "measured" },
reserved: { text: "0", unit: "cents", certainty: "estimated" },
remaining: { text: "688", unit: "cents", certainty: "measured" },
limit: { text: "2500", unit: "cents", certainty: "measured" },
level: "ok",
bar: { used: "72.48", reserved: "0", limit: "100", hardLimit: null, alerts: ["80"] },
// plus id, window, resetsAt, boundary and more
}

Sample requests run against the in-memory Meter only.

Read hooks

  • useUsageView
  • useUsageSummary
  • useBudgetsView
  • useDefinedBudgets
  • useHeaderStatus
  • useCoverageView
  • useExceptionsView

Provider hooks read connections, balances, quotes and allocations through a port your application supplies. About provider hooks

Make every unit count.

Reserve before the call, settle from the receipt, and show every user exactly where they stand.

npm install @usagekit/core @usagekit/store @usagekit/meter @usagekit/providers