Revenue
since last week
One figure, its change since the last period, and recent periods as bars. Pass several metrics and it steps through them.
Run this in a project that has a components.json. It adds one file, components/tenor-ui/growth-card.tsx, and no packages.
pnpm dlx shadcn@latest add https://tenor.design/r/growth-card.jsonNo components.json? Fetch the file. It works in any React project.
curl --create-dirs -o src/components/tenor-ui/growth-card.tsx https://tenor.design/r/growth-card.tsxEvery prop is optional. With none, it renders the content you see above.
<GrowthCard />import { GrowthCard } from "@/components/tenor-ui/growth-card";
export function WeeklyRevenue() {
return (
<GrowthCard
metrics={[
{ label: "Revenue", value: 84210, change: 24, bars: [34, 45, 58, 74, 100] },
{ label: "Costs", value: 32640, change: -12, bars: [100, 88, 79, 71, 63] },
]}
unit="USD"
caption="since last week"
/>
);
}| Prop | Type | Default | What it does |
|---|---|---|---|
metrics | readonly GrowthCardMetric[] | growthCardMetrics | Metrics to show. More than one makes the card step through them. |
unit | string | "USD" | Unit shown after the figure. |
caption | string | "since last week" | Line under the change. |
interval | number | 4800 | Milliseconds each metric stays up before the next. 0 keeps the first metric. |
locale | string | "en-US" | Locale used to format the figure. |
It also takes every attribute of its root element, such as className and style.
Set any of these CSS variables on the component or on an ancestor. Each falls back to the look shown here.
--tui-surface--tui-stroke--tui-text--tui-muted--tui-bar-from--tui-bar-to--tui-font-sans--tui-font-mono