About
A labeled figure for dashboards that rolls its digits to a new value, shows a trend arrow or percentage, and can draw a hoverable/keyboard-scrubbable sparkline (line or bars) beneath it.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Stat to your project and fits it to your theme.
Code
How Stat is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import Stat from "@/components/ui/stat";
const weeks = Array.from({ length: 8 }, (_, i) => `Week ${i + 1}`);
const attendance = [0.97, 0.96, 0.95, 0.93, 0.92, 0.94, 0.93, 0.91];
/** Weekly attendance read one bar at a time: the last bar carries the trend's tone, the rest sit
* quieter, and it still keeps the spring-follow and pointer/keyboard scrub. */
export default function BarsVariantDemo() {
return (
<div className="w-80 rounded-xl border border-[color:var(--color-border)] bg-[var(--color-bg,#f5f5f5)] p-6 dark:bg-[#0a0a0a]">
<Stat
label="Attendance"
value={0.91}
options={{ style: "percent" }}
trend={-4}
trendTone="negative"
series={attendance}
labels={weeks}
variant="bars"
description="Last eight weeks"
/>
</div>
);
}














