Skip to the page
Supply UI

Waterfall

Things that start and last, as bars on one time axis: a page's requests, the steps of a job, a trace. Each span has a value, a label, a start and a duration in milliseconds, and may hold the spans it started as children: those open and close with the arrow keys or a press on the arrow. value and onValueChange hold the chosen span.

Preview

Request
First content
/bookings
api/bookings
Sign-in check
Database
inter.woff2
Photos

Use

The code of the preview above
import { Waterfall } from '@/components/ui';

<div className="ui-grow">
  <Waterfall
    aria-label="Loading the bookings page"
    items={REQUESTS}
    defaultExpanded={['data']}
    nameHeader="Request"
    marks={[{ time: 500, label: 'First content' }]}
    format={{ style: 'unit', unit: 'millisecond', unitDisplay: 'narrow' }}
  />
</div>

This page as text, for an AI

Options

OptionTypeWhat it does
aria-label NeededstringDefines a string value that labels the current element. What it shows: "Network requests".
className stringMore classes on the outer element, for layout around it (margins, grid placement), not to restyle it.
columns { header: ReactNode; cell: (span: WaterfallDataItem) => ReactNode; }[] · default []More columns between the name and the bars: a size, a status.
marks { time: number; label: ReactNode; }[] · default []Moments marked on the time axis, in milliseconds: "First paint".
maxTicks number · default 5The most ticks on the axis.
nameHeader ReactNodeThe heading over the names.

It also takes the 289 attributes of the element or UI SDK part it draws: className, aria-label, events and the rest.

Without React

The same look on any HTML, with the classes (React only).

With the CSS in parts (/ui/css/), it needs these, besides the ones every page loads:

components/icons.cssparts/waterfall.css

In the examples

Small screens made with it and the rest of the kit. They work: click, type and choose in them.

Ticket
Covers
20 min
Table 12
4
Pumpkin soup
Cod, brown butter
Table 9
6
Bar snacks
—
Order to pass, timed Each ticket on one time line; open a table for its dishes

Showing things: states, do and don’t

Things that start and last, as bars on one time axis: a page's requests, the steps of a job. items are { value, label, start, duration, children? } in milliseconds; spans with children open and close.

States. Lists, tables and boards have three more states besides their content: empty (Empty, with the first action inside), loading (Skeleton) and failed (Alert tone="danger"). A chosen row shows in ink, never in the brand colour.

Do

  • Put numbers, dates and codes in ui-mono (in a table cell, ui-num, which also aligns them).
  • Let a Table turn into blocks on a phone; give it scroll only when it is read down its columns.
  • Show a status in words and colour together (Badge tone="success" with "Paid"), never colour alone.

Don't

  • Don't put a card round a Table, List, Cells, Calendar or Empty: they draw their own box.
  • Don't truncate a name or a price to fit; let it wrap. Truncate only file names and addresses.
  • Don't use the status colours (success, warning, danger, info) for anything but those meanings.