Several series over time as soft gradient areas, stacked, overlapping or as 100% shares, in a dashboard card with a headline, change badge and period switch.
Revenue by month
Stacked areas add up to the month's total. Hover or focus a month (arrow keys move) for its split; the period menu swaps the data.
Revenue
$497,800
+18.2% vs the year before| Month | Retainers | Projects | Workshops | Total |
|---|---|---|---|---|
| Jan | $18,400 | $9,200 | $1,800 | $29,400 |
| Feb | $18,400 | $12,600 | $2,400 | $33,400 |
| Mar | $19,800 | $11,800 | $0 | $31,600 |
| Apr | $19,800 | $15,400 | $3,200 | $38,400 |
| May | $21,200 | $14,200 | $2,600 | $38,000 |
| Jun | $21,200 | $18,900 | $4,100 | $44,200 |
| Jul | $22,600 | $16,400 | $1,800 | $40,800 |
| Aug | $22,600 | $13,100 | $0 | $35,700 |
| Sep | $24,000 | $19,800 | $3,600 | $47,400 |
| Oct | $24,000 | $22,400 | $4,800 | $51,200 |
| Nov | $25,400 | $21,600 | $3,900 | $50,900 |
| Dec | $25,400 | $26,200 | $5,200 | $56,800 |
- Retainers$262,800
- Projects$201,600
- Workshops$33,400
Installation
Copies the component into src/design-system/ as your own source, with only the files it needs.
npx avesk-ui@latest add area-chart-cardBrings the 8 files it builds on (chart.tsx, badge.tsx, dropdown-menu.tsx, button.tsx, glyph.tsx, icon.tsx, floating.tsx, segmented-control.tsx). The first time, it also adds the tokens and the cn() helper, imports the tokens in globals.css and installs clsx and tailwind-merge. Files already in your project are kept unless you add --force.
Import
Lives in src/design-system/components/area-chart-card.tsx.
import { AreaChartCard } from "@/design-system/components/area-chart-card";Usage
<AreaChartCard
title="Revenue"
data={[{ label: "Jan", retainers: 18400, projects: 9200 }, …]}
series={[
{ key: "retainers", label: "Retainers" },
{ key: "projects", label: "Projects" },
]}
change={0.182}
format={(n) => formatMoney(n)}
formatAxis={(n) => formatMoney(n, { compact: true })}
period={{ value: year, onChange: setYear, display: "menu", options }}
/>Examples
Overlap
variant="overlap" draws every series from zero so they can be compared; curve="linear" uses straight segments, and a SegmentedControl switches the range.
Team hours
1,579 h
| Week | Billable | Internal | Total |
|---|---|---|---|
| Wk 41 | 248 h | 61 h | 309 h |
| Wk 42 | 272 h | 48 h | 320 h |
| Wk 43 | 231 h | 79 h | 310 h |
| Wk 44 | 286 h | 52 h | 338 h |
| Wk 45 | 278 h | 74 h | 352 h |
| Wk 46 | 264 h | 66 h | 330 h |
- Billable1,579 h
- Internal380 h
Share of each period
variant="percent" fills every period to 100%, so the chart reads as a mix. The tooltip shows each value and its share.
Revenue mix
$1,171,000
| Quarter | Retainers | Websites | Branding | Total |
|---|---|---|---|---|
| Q1 25 | $38,000 | $61,000 | $42,000 | $141,000 |
| Q2 25 | $41,000 | $72,000 | $38,000 | $151,000 |
| Q3 25 | $47,000 | $66,000 | $51,000 | $164,000 |
| Q4 25 | $55,000 | $58,000 | $46,000 | $159,000 |
| Q1 26 | $58,000 | $81,000 | $39,000 | $178,000 |
| Q2 26 | $63,000 | $77,000 | $44,000 | $184,000 |
| Q3 26 | $66,000 | $92,000 | $36,000 | $194,000 |
- Retainers$368,000
- Websites$507,000
- Branding$296,000
When to use
Use it when
- A total over time and what it is made of: revenue by month split into retainers, projects and workshops
- Comparing two or three trends on one scale (variant="overlap"), e.g. billable against internal hours
- How a mix shifts over time (variant="percent")
Don’t use it when
- A volume and a rate with different units → Combo chart card
- A ranking of items, not a trend → Bar list card
- A single number with no trend → Stat card
Rules
- 2–4 series; more than that turns the stack into stripes
- Order series bottom-up from the steadiest (retainers) to the most volatile
- Pass `format` for the values and a compact `formatAxis` for the axis, e.g. formatMoney with compact
- Use a SegmentedControl period (default) for 2–3 short options and display="menu" for longer labels
Properties
AreaChartCard
| Prop | Type | Default |
|---|---|---|
title * | string | – |
data * | ChartRow[] | – |
series * | ChartSeries[] | – |
variant | "stacked" | "overlap" | "percent" | "stacked" |
curve | "smooth" | "linear" | "smooth" |
value | string | – |
change | number | – |
changeLabel | string | "vs previous period" |
invertChange | boolean | false |
period | ChartPeriod | – |
format | NumberFormat | formatNumber |
formatAxis | NumberFormat | formatCompact |
categoryLabel | string | "Period" |
footer | "tiles" | "legend" | "none" | "tiles" |
height | number | 196 |
headingLevel | 2 | 3 | 4 | 3 |
className | string | – |
* required
Accessibility
- The SVG has role="img" and an aria-label summary; a visually hidden table lists every value
- Every period or item is a focusable target with one Tab stop: arrows move, Home/End jump, Escape hides the tooltip; its aria-label reads the values
- The tooltip and headline follow hover and focus alike; meaning never relies on colour (labels and values sit next to every swatch)
- The draw-in animation only runs without prefers-reduced-motion