# Area Chart

> A time-series chart with soft area washes and one crosshair that reads every series at once.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Blocks › Charts |
| Live preview | https://uibrik.com/components/area-chart |
| Writes | 1 files into `components/uibrik/area-chart/`, plus `components/uibrik/_charts/chart-kit.tsx` |
| Packages | `@number-flow/react`, `@tabler/icons-react`, `motion`, `react-use-measure` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 9, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/area-chart.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/area-chart`.

Can't run commands? https://uibrik.com/components/area-chart/prompt-full.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { AreaChart } from "@/components/uibrik/area-chart/area-chart";

<AreaChart
  title="Visitors"
  format={{}}
  accent=""
  series={[{ key: "visitors", label: "Visitors" }]}
  headline="total"
  showGrid
  height={220}
  onActiveChange={(index) => {}}
  // data={[…]}
  // previous={[0]}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/area-chart.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `title` | `string` | `"Visitors"` | Names what is plotted. |
| `format` | `Intl.NumberFormatOptions` | `{}` | Formats every number, e.g. { style: "currency", currency: "USD" }. |
| `accent` | `string` | `""` | First series colour. Empty uses the chart palette. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `data` | `({ label: string } & Record<string, number>)[]` |  | One row per period, oldest first, with a value per series key. |
| `series` | `{ key: string; label: string; color?: string }[]` |  | The series to draw, 1 to 5. |
| `previous` | `number[]` |  | The first series over the previous period, drawn dashed for comparison. |
| `headline` | `"total" \| "latest"` | `"total"` | Headline is the period's sum or its latest value. |
| `showGrid` | `boolean` | `true` | Grid lines with value labels. |
| `height` | `number` | `220` | Plot height in px. |
| `onActiveChange` | `(index: number \| null) => void` |  | Called with the row under the cursor. |
| `className` | `string` |  | Classes for the outer shell. |

## Where it fits

- **Traffic and revenue trends**: Soft area washes show volume over time while staying readable when several series overlap. Pairs with [KPI Tile](https://uibrik.com/components/kpi-tile.md).
- **Comparing metrics**: One crosshair reads every series at the same moment, so users compare signups, revenue and churn without hovering each line. Pairs with [Stacked Bars](https://uibrik.com/components/stacked-bars.md) (Pro).
- **Monitoring and analytics**: A calm time-series chart fits product analytics and server metrics pages alike. Pairs with [Live Line](https://uibrik.com/components/live-line.md) (Pro).

## Same shelf: Charts

- [Bar List](https://uibrik.com/components/bar-list.md): A ranked list of top pages, referrers or countries whose rows slide to their new rank and resize when you switch lists.
- [Cohort Retention](https://uibrik.com/components/cohort-retention.md): Weekly retention as the classic triangle: a row per signup cohort, a column per week, each cell shaded by the share still active. Cells fill in a diagonal wave as the weeks unlock. Above, the chosen cohort's curve draws against the dashed average and morphs to each new cohort. Hovering a cell crosses its row and week and reads the users kept and the gap to average; cells switch between shares and user counts.
- [Flame Graph](https://uibrik.com/components/flame-graph.md) (Pro): A CPU profile as a flame graph: a row per call depth, each frame as wide as the time spent in it. Rows wipe in from the root down. Clicking a frame zooms it to the full width while its callers stay on top as crumbs, with no text stretching; hovering lights every call to the same function and reads its total and self time. Below, the functions with the most self time jump straight to their frame. App code takes the accent, libraries stay neutral and native code takes a second hue, all shaded by how hot they run.
- [Flow Chart](https://uibrik.com/components/flow-chart.md) (Pro): A Sankey of flows between columns: point at a node or ribbon to light its whole path while the rest recede.
- [Funnel](https://uibrik.com/components/funnel.md) (Pro): A conversion funnel whose drop-off between steps reads as a slope you can hover, with every step's share of the start.
- [Heatmap Rank](https://uibrik.com/components/heatmap-rank.md) (Pro): An activity heatmap that turns into a ranking, where each row's day cells slide together into one bar and the bars sort by total, and that drills down: a day cell opens into hour tiles, an hour opens into its commits.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/area-chart/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
