Brush chart
A dense time series with an overview strip: drag a window to zoom, resize it by its handles, and read events in place.
pnpm dlx shadcn@latest add @uiarc/brush-chartDaily active users
Daily active users, Sep 21, 2024 to Sep 20, 2026. Showing Jun 23, 2026 to Sep 20, 2026.
| Date | Daily active users | Event |
|---|---|---|
| Jun 23, 2026 | 17,915 users | |
| Jun 24, 2026 | 16,983 users | |
| Jun 25, 2026 | 17,249 users | |
| Jun 26, 2026 | 17,354 users | |
| Jun 27, 2026 | 12,582 users | |
| Jun 28, 2026 | 12,503 users | |
| Jun 29, 2026 | 17,841 users | |
| Jun 30, 2026 | 17,385 users | |
| Jul 1, 2026 | 17,937 users | |
| Jul 2, 2026 | 16,931 users | |
| Jul 3, 2026 | 17,207 users | |
| Jul 4, 2026 | 12,422 users | |
| Jul 5, 2026 | 12,855 users | |
| Jul 6, 2026 | 17,152 users | |
| Jul 7, 2026 | 16,914 users | |
| Jul 8, 2026 | 17,064 users | |
| Jul 9, 2026 | 16,741 users | |
| Jul 10, 2026 | 16,808 users | |
| Jul 11, 2026 | 13,155 users | |
| Jul 12, 2026 | 12,407 users | |
| Jul 13, 2026 | 17,440 users | |
| Jul 14, 2026 | 16,987 users | |
| Jul 15, 2026 | 17,267 users | |
| Jul 16, 2026 | 16,654 users | |
| Jul 17, 2026 | 16,754 users | |
| Jul 18, 2026 | 12,547 users | |
| Jul 19, 2026 | 12,794 users | |
| Jul 20, 2026 | 16,507 users | |
| Jul 21, 2026 | 17,563 users | |
| Jul 22, 2026 | 16,812 users | |
| Jul 23, 2026 | 16,574 users | |
| Jul 24, 2026 | 17,384 users | |
| Jul 25, 2026 | 12,784 users | |
| Jul 26, 2026 | 12,503 users | |
| Jul 27, 2026 | 16,165 users | |
| Jul 28, 2026 | 17,246 users | |
| Jul 29, 2026 | 16,703 users | |
| Jul 30, 2026 | 16,883 users | |
| Jul 31, 2026 | 16,554 users | |
| Aug 1, 2026 | 12,212 users | |
| Aug 2, 2026 | 12,488 users | |
| Aug 3, 2026 | 16,426 users | |
| Aug 4, 2026 | 16,863 users | |
| Aug 5, 2026 | 17,159 users | |
| Aug 6, 2026 | 16,599 users | |
| Aug 7, 2026 | 17,040 users | |
| Aug 8, 2026 | 12,323 users | |
| Aug 9, 2026 | 12,429 users | |
| Aug 10, 2026 | 17,126 users | |
| Aug 11, 2026 | 16,963 users | |
| Aug 12, 2026 | 17,460 users | |
| Aug 13, 2026 | 16,985 users | |
| Aug 14, 2026 | 17,482 users | |
| Aug 15, 2026 | 12,970 users | |
| Aug 16, 2026 | 13,473 users | |
| Aug 17, 2026 | 17,553 users | |
| Aug 18, 2026 | 18,239 users | |
| Aug 19, 2026 | 18,381 users | |
| Aug 20, 2026 | 18,064 users | |
| Aug 21, 2026 | 18,647 users | |
| Aug 22, 2026 | 13,650 users | |
| Aug 23, 2026 | 14,003 users | |
| Aug 24, 2026 | 18,501 users | |
| Aug 25, 2026 | 19,097 users | |
| Aug 26, 2026 | 19,569 users | |
| Aug 27, 2026 | 18,963 users | |
| Aug 28, 2026 | 19,535 users | |
| Aug 29, 2026 | 13,906 users | |
| Aug 30, 2026 | 13,770 users | |
| Aug 31, 2026 | 19,088 users | |
| Sep 1, 2026 | 19,507 users | |
| Sep 2, 2026 | 19,535 users | |
| Sep 3, 2026 | 19,450 users | |
| Sep 4, 2026 | 19,818 users | |
| Sep 5, 2026 | 13,843 users | |
| Sep 6, 2026 | 14,092 users | |
| Sep 7, 2026 | 19,388 users | |
| Sep 8, 2026 | 20,105 users | |
| Sep 9, 2026 | 18,927 users | |
| Sep 10, 2026 | 19,300 users | |
| Sep 11, 2026 | 19,774 users | |
| Sep 12, 2026 | 14,675 users | |
| Sep 13, 2026 | 14,410 users | |
| Sep 14, 2026 | 19,699 users | |
| Sep 15, 2026 | 19,450 users | |
| Sep 16, 2026 | 19,574 users | |
| Sep 17, 2026 | 19,267 users | |
| Sep 18, 2026 | 20,111 users | |
| Sep 19, 2026 | 14,478 users | |
| Sep 20, 2026 | 14,147 users |
- Product analytics with a year or more of daily data.
- Incident reviews where events need to be read against a metric.
- Any chart where people ask to zoom into a stretch without losing context.
- Use line-chart for a few weeks of data or several series.
- Use sparkline for a small inline trend without interaction.
- Avoid it for data that dips below zero or needs a log scale.
Installation
Add Brush chart with the shadcn CLI, or copy the source by hand.
pnpm dlx shadcn@latest add @uiarc/brush-chartAdds the component and its local dependencies, and installs motion. First time? Add the @uiarc registry to components.json, or use the full URL:
import { useState } from "react";import { BrushChart } from "@/registry/components/brush-chart/brush-chart"; export function ActiveUsers({ days }: { days: { date: number; value: number }[] }) { const [range, setRange] = useState<[number, number]>([days[days.length - 90].date, days[days.length - 1].date]); return <BrushChart data={days} label="Daily active users" unit="users" range={range} onRangeChange={setRange} annotations={[{ date: Date.UTC(2026, 2, 24), label: "v2", description: "Offline mode and shared spaces" }]} />;}BrushChart
A detailed time series with an overview strip. Drag the window to pan, its handles to resize, or across empty track to draw a new one; double click resets. Zoomed out, a seven point average and band replace the raw line.
dataRequired{ date: Date | number; value: number }[]–Points in ascending time order.labelRequiredstring–Names the chart for assistive technology.unitstring""Unit after values in the tooltip and table.formatValue(value: number) => string–Formats values in the tooltip and table.formatTick(value: number) => string–Formats the value axis. Defaults to a compact number.formatDate(date: Date) => string–Formats dates in the tooltip and announcements.annotations{ date: Date | number; label: string; description?: string }[][]Events drawn as markers on both charts; labels show where they fit.range[number, number]–Controlled window as epoch milliseconds. A new value glides the window there.defaultRange[number, number]–Initial window when uncontrolled. Defaults to the whole series.onRangeChange(range: [number, number]) => void–Called while the window is dragged, resized, stepped, or reset.minSpannumber7 daysSmallest window in milliseconds.heightnumber240Main plot height in pixels.overviewHeightnumber52Overview strip height in pixels.emptyLabelstring"No data yet"Shown with fewer than two points.classNamestring–Extra class on the figure.- ArrowLeftorArrowRight (plot)
- Moves the crosshair between points in view.
- ArrowLeftorArrowRight (window)
- Pans by a tenth of the window; Shift or PageUp and PageDown pan by half.
- +or- (window)
- Zooms in or out around the window's centre.
- ArrowLeftorArrowRight (handles)
- Moves that edge by one point; Shift moves by ten.
- HomeorEnd
- Moves the window or edge to the start or end.
- Escapeor0
- Resets the window to the whole series.
- The window and both handles are sliders with dates as aria-valuetext.
- The plot is a focusable group; each reading is announced with its date, value, and any event on that day.
- A visually hidden table lists every point in the window with its event.
- Event markers pair the second series hue with a text label or tooltip; they never rely on color alone.
- The line draws in from the left once, the first time it is seen.
- Dragging tracks the pointer 1:1; presets, resets, and controlled changes glide the window on a spring.
- The value axis springs to the tallest point in view, and the raw line crossfades with the smoothed trend as density changes.
- Reduced motion places the window directly and keeps the crosshair without travel.
- Both charts fill their container; date ticks pick days, weeks, months, or years to fit the width.
- Handles have a 28 by 44px hit area for touch, and the strip keeps vertical page scroll free.
- Event labels are placed left to right and skip themselves when they would collide.
- Past two points per pixel, each pixel column keeps only its low and high, so spikes survive and paths stay small.
- The overview path is built once per width; the rolling average is computed once per data change.
- Window moves re-render one component; a few thousand points stay smooth.
Notes for AI
Give your coding assistant the Markdown reference instead of screenshots.
- Choose it for long daily or hourly series where people need both the whole history and a close look.
- Control range to sync presets (30D, 90D, 1Y) or other charts with the window.
- Use annotations for launches, incidents, and pricing changes; keep labels to a word or two.
- The value axis starts at zero, so it suits counts and totals rather than prices that hover far from zero.
The full library index for assistants is at /llms.txt.