Interactive Answers
Iso Bars
Isometric stacked bars in two rows — the main volume behind, rework or failures in front.
2 variantsMIT
Preview
Daily tokens
support-agent · last 14 days
20.8Mtokens
failed 3.0%
InputCachedOutputReasoningFailedRetried
| Period | Input | Cached | Output | Reasoning | Failed | Retried |
|---|---|---|---|---|---|---|
| Oct 23 | 520k | 380k | 210k | 102k | 26k | 48k |
| Oct 24 | 569.4k | 444.3k | 262.4k | 111.3k | 36.7k | 71k |
| Oct 25 | 314.2k | 262.6k | 129.6k | 75.5k | 19k | 42k |
| Oct 26 | 327.5k | 259.9k | 130.4k | 63k | 16k | 45.5k |
| Oct 27 | 631.2k | 523.4k | 271.1k | 143.7k | 49.4k | 83.4k |
| Oct 28 | 651.5k | 512.6k | 266.2k | 154.1k | 39.4k | 82.6k |
| Oct 29 | 612.6k | 549.8k | 260.4k | 134.8k | 43k | 76.3k |
| Oct 30 | 614.9k | 589.5k | 290.9k | 124.5k | 42.6k | 85.5k |
| Oct 31 | 628.1k | 618.9k | 297.3k | 275.8k | 180k | 252k |
| Nov 1 | 399.1k | 368.1k | 159.8k | 170.6k | 21.7k | 35.4k |
| Nov 2 | 366.8k | 395.3k | 167.9k | 176.2k | 21.2k | 53.3k |
| Nov 3 | 727.1k | 726.5k | 308.3k | 348.9k | 53.2k | 90k |
| Nov 4 | 733.7k | 724.5k | 326.1k | 335.8k | 37.8k | 93.7k |
| Nov 5 | 701.4k | 758.4k | 294.3k | 325k | 45.5k | 81.5k |
Installation
Copies the component into components/ui and installs its dependencies and theme tokens.
pnpm dlx shadcn@latest add https://tuffui.com/r/iso-bars.jsonUsage
Pass your own data and wire the callbacks to your agent runtime.
import { IsoBars } from "@/components/ui/iso-bars";
export function DailyTokens({ usage }: { usage: DailyUsage }) {
return (
<IsoBars
title="Daily tokens"
subtitle="Last 14 days"
labels={usage.days} // "Oct 23" … "Nov 5"
back={[
{ id: "input", label: "Input", values: usage.input },
{ id: "cached", label: "Cached", values: usage.cached },
{ id: "output", label: "Output", values: usage.output },
]}
front={[
{ id: "failed", label: "Failed", values: usage.failed },
{ id: "retried", label: "Retried", values: usage.retried },
]}
aside={{ value: "18.4M", caption: "tokens", flag: "failed 1.9%" }}
onSelect={({ row, index }) => openDay(usage.days[index], row)}
/>
);
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
| labels* | string[] | — | One label per period, drawn along the front edge of the floor. |
| back* | IsoSeries[] | — | The main stack, drawn as the back row. Series stack upward in order. |
| front | IsoSeries[] | — | A smaller stack in front, e.g. rework or failures. Shares the back row's scale and defaults to warning and negative colors. |
| title* | string | — | Header title. |
| subtitle | string | — | Secondary line under the title. |
| aside | { value: string; caption?: string; flag?: string; tone?: "warning" | "negative" } | — | Headline in the header. The flag sits under it in the tone color. |
| format | (value: number) => string | — | Formats values in the tooltip and the table. Defaults to 1.2k. |
| onSelect | (point: { row: "back" | "front"; index: number }) => void | — | Called when a prism is hovered, clicked or reached with the arrow keys. |
| className | string | — | Extra classes for the root element. |
type IsoSeries = {
id: string;
label: string;
values: number[]; // one per period
color?: string; // faces are shaded from it with color-mix
};