Usage Based Pricing
Usage-based pricing section showing per-request rate, gradient progress meter, and estimated monthly cost. API, AI token, and metered billing landing page block with tabular-nums typography.
Dependencies
react
npm install react react-domexport function UsageBasedPricing() {
return (
<section className="mx-auto max-w-xl rounded-2xl border border-zinc-800 bg-zinc-950 p-8 text-white">
<h2 className="text-xl font-semibold">Pay as you grow</h2>
<p className="mt-2 text-sm text-zinc-400">$0.002 per API request · no minimum</p>
<div className="mt-6 h-2 rounded-full bg-zinc-800">
<div className="h-2 w-2/3 rounded-full bg-gradient-to-r from-cyan-500 to-indigo-500" />
</div>
<p className="mt-4 text-3xl font-bold tabular-nums">~$24<span className="text-base text-zinc-500">/mo est.</span></p>
</section>
);
}
Please implement this code in the current project and add it to (Your Desired Section, e.g. homepage hero, pricing page, dashboard). Change the primary accent color to (YOUR HEX CODE COLOR, e.g. #6366F1).
Requirements:
- Use React + Tailwind CSS (match the project's existing setup)
- Install dependencies if needed: npm install react react-dom
- Keep the layout responsive on mobile and desktop
- Replace placeholder copy with content that fits the project
The UI code:
export function UsageBasedPricing() {
return (
<section className="mx-auto max-w-xl rounded-2xl border border-zinc-800 bg-zinc-950 p-8 text-white">
<h2 className="text-xl font-semibold">Pay as you grow</h2>
<p className="mt-2 text-sm text-zinc-400">$0.002 per API request · no minimum</p>
<div className="mt-6 h-2 rounded-full bg-zinc-800">
<div className="h-2 w-2/3 rounded-full bg-gradient-to-r from-cyan-500 to-indigo-500" />
</div>
<p className="mt-4 text-3xl font-bold tabular-nums">~$24<span className="text-base text-zinc-500">/mo est.</span></p>
</section>
);
}
Replace (Your Desired Section) and (YOUR HEX CODE COLOR) before pasting into Cursor, Copilot, or ChatGPT.