Usage forecastPro
Actual and projected usage against a budget, with the day you'll cross it.
What's inside
- Actual vs projected with confidence band
- Budget crossing marker
- Alert thresholds
When to use
- Usage-billed products: cloud, AI tokens, API calls.
When not to use
- Flat-priced plans.
Installation
Usage
Import it from @/components/blocks/usage-forecast after installing. It ships with sample data, so it renders straight away; swap in your own data when you're ready.
import { UsageForecast } from "@/components/blocks/usage-forecast";
export default function Page() {
return (
<main className="mx-auto max-w-6xl p-6">
<UsageForecast />
</main>
);
}API reference
UsageForecast
Actual and projected spend with a confidence band, the day you'll cross the budget, and alert thresholds. Also the default export. No props: sample data sits at the top of the file, ready to swap for your own.
No props.
Keyboard interactions
| Keys | Action |
|---|---|
| Tab | Reach tabs and threshold checkboxes |
| ←or→ | Switch tabs |
| Space | Toggle a threshold |
Accessibility
- The chart has role="img" with a text summary of the projection.
- Threshold checkboxes are labelled with their amounts.
Motion
- Projection and band fade in after the actual line.
Responsive behavior
- Thresholds stack under the chart on phones.
Performance
- Sample data is plain arrays at the top of the file. Replace them with your API data and keep the shapes.
- The projection is a simple linear fit computed once per render.
Notes for AI
- Replace the linear projection with your own model if you have one.
This page as Markdown, for assistants and coding agents:
/blocks/usage-forecast/markdownThe full library index for assistants is at /llms.txt.
Lode222 doc pagesllms.txt