Block
Usage Card
Plan usage for the current billing cycle.
react-aria-componentslucide-react
Preview
Usage this cycle
Growth plan · Sep 1 – Sep 30 · resets Oct 1
AI credits6,240 / 10,000
62% used
Enrichments1,912 / 3,000
64% used
AI searches148 / 500
30% used
Emails sent3,960 / 8,000
50% used
import { UsageCard } from "@/components/blocks/usage-card";
import { usage } from "@/lib/demo-data";
export default function Example() {
return <UsageCard items={usage} className="w-full" />;
}Installation
Components are copied into your project — no runtime package.
Install the following dependencies:
terminalnpm install react-aria-components lucide-reactCreate a
usage-card.tsxfile and paste the following code into it.src/components/blocks/usage-card.tsx"use client"; import { Gauge } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Card, CardHeader, IconTile } from "@/components/ui/card"; import { ProgressBar } from "@/components/ui/progress-bar"; import { cx } from "@/utils/cx"; export interface UsageItem { label: string; value: number; max: number; } /** Plan usage for the current billing cycle. */ export function UsageCard({ items, compact, className }: { items: UsageItem[]; /** One column for narrow columns and side rails. */ compact?: boolean; className?: string }) { return ( <Card className={className}> <CardHeader icon={ <IconTile tone="orange"> <Gauge /> </IconTile> } title="Usage this cycle" description="Growth plan · Sep 1 – Sep 30 · resets Oct 1" actions={<Button size="sm">Manage plan</Button>} /> <div className={cx("grid gap-px overflow-hidden rounded-[12px] border border-line bg-line", compact ? "grid-cols-1" : "sm:grid-cols-2 lg:grid-cols-4")}> {items.map((u) => ( <ProgressBar key={u.label} className="bg-surface p-4" label={u.label} value={u.value} max={u.max} showValue caption={`${Math.round((u.value / u.max) * 100)}% used`} /> ))} </div> </Card> ); }Add the theme tokens and the
cxhelper from Installation if you haven’t yet, then update the import paths to match your project setup.