Data

Dashboard

A whole dashboard where changing the range rolls every number, raises the bars, flows the trend and reorders the ranking together.

Preview

Installation

Terminal
npx @usefluid/cli add dashboard

Usage

Dashboard.tsx
import { Dashboard } from "./Dashboard";

const [range, setRange] = useState("week");
<Dashboard title="Store" ranges={ranges} value={range} onChange={setRange} />

API reference

PropTypeDefaultDescription
titlestring—The heading of the dashboard.
rangesRange[]—One entry per tab, such as week, month and year, each with its stats, trend, bars, goal and leaders. See the Range type.
valuestring—The id of the range shown.
onChange(id) => void—Called when another range is picked.
colorsstring[]violet, teal, orange, pinkThe colours of the stats and charts, in order.
localestringthe browser'sLocale for numbers and percents.

Keyboard and screen readers

The range is a tab list: arrow keys move between ranges. Every piece keeps its own reading: stats read their final values, bars are buttons, the trend is an image, the goal is a progress bar and the ranking is an ordered list. With reduced motion every change is immediate.

Notes

It is a starting point: copy it, drop the parts you do not need, and feed it your real numbers. Keep trendMax and barsMax the same across ranges when the numbers are comparable. Every piece inside is yours to change.

How it is made

It is made of the Data pieces: Stat Counter, Area Morph, Spring Bars, Progress Ring, Rank List, Donut Morph and Dot Grid, with Pill Tabs for the range. Each keeps its own springs, so one change spreads through the page at slightly different speeds, like a single motion. Colours come in order from a palette you can replace.

For your agent

For your agent

Add Dashboard to my project with the Fluid library. Build my dashboard with Dashboard, using my real metrics for each range and my brand colours. Read my project first. Use my logo, my colours and my font through the --fluid-* variables. Keep 44px touch targets, visible focus and reduced motion. If I have no SVG logo, ask before making one up.