Skip to contentKino
Skip to Content

Waterfall

A trace, or a page’s requests, as bars on one time axis. Each span opens to show the spans inside it, and the one under the pointer stays bright while the rest step back.

npx shadcn add https://kinoui.com/r/waterfall.json
Share on

Examples

POST /api/checkout

Trace 4bf92f35 · 16 Nov, 14:32:07 · 1.24 s
1 error
SpanDuration
  • POST /api/checkout, Edge, starts at 0 ms, lasts 1,240 ms
    • payments.charge, API, starts at 236 ms, lasts 812 ms
      • POST /v1/payment_intents, Stripe, starts at 242 ms, lasts 388 ms, Failed: Stripe answered 502 Bad Gateway. Retried after 40 ms.
      • POST /v1/payment_intents (retry), Stripe, starts at 670 ms, lasts 352 ms
      • INSERT INTO payments, Postgres, starts at 1,026 ms, lasts 19 ms
    • render response, Edge, starts at 1,198 ms, lasts 38 ms
Span
POST /v1/payment_intents
Service
Stripe
Starts
242 ms
Duration
388 ms
Error
Stripe answered 502 Bad Gateway. Retried after 40 ms.

Default

Point at a span to light it and read its times, press it to pick it, and open a span to see the spans inside it.

kino.dev/pricing

8 requests · 736 ms · Chrome on a fast 4G line
SpanDuration
  • kino.dev/pricing, Document, starts at 0 ms, lasts 182 ms
  • app.3f9c1a.css, Style, starts at 196 ms, lasts 64 ms
  • inter-var.woff2, Font, starts at 204 ms, lasts 118 ms
  • framework.8b21e0.js, Script, starts at 198 ms, lasts 236 ms
  • pricing.c47d9e.js, Script, starts at 210 ms, lasts 154 ms
  • hero-dashboard.avif, Image, starts at 362 ms, lasts 288 ms
  • customers.svg, Image, starts at 371 ms, lasts 41 ms
  • analytics.js, Script, starts at 640 ms, lasts 96 ms, Failed: Blocked by the browser: 403

Requests

A flat list works too: a page’s requests, each a row, coloured by what they fetch.

cron: nightly workspace sync

Trace 51c8b2d0 · 16 Nov, 02:00:00 · 3.9 s
SpanDuration
  • cron: nightly workspace sync, Edge, starts at 0 ms, lasts 3,900 ms
    • sync.workspace 1 of 24, API, starts at 20 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 24 ms, lasts 60 ms
      • SET search-index, Redis, starts at 88 ms, lasts 0.4 ms
    • sync.workspace 2 of 24, Postgres, starts at 180 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 184 ms, lasts 60 ms
      • SET search-index, Redis, starts at 248 ms, lasts 0.4 ms
    • sync.workspace 3 of 24, Redis, starts at 340 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 344 ms, lasts 60 ms
      • SET search-index, Redis, starts at 408 ms, lasts 0.4 ms
    • sync.workspace 4 of 24, API, starts at 500 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 504 ms, lasts 60 ms
      • SET search-index, Redis, starts at 568 ms, lasts 0.4 ms
    • sync.workspace 5 of 24, Postgres, starts at 660 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 664 ms, lasts 60 ms
      • SET search-index, Redis, starts at 728 ms, lasts 0.4 ms
    • sync.workspace 6 of 24, API, starts at 820 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 824 ms, lasts 60 ms
      • SET search-index, Redis, starts at 888 ms, lasts 0.4 ms
    • sync.workspace 7 of 24, Postgres, starts at 980 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 984 ms, lasts 60 ms
      • SET search-index, Redis, starts at 1,048 ms, lasts 0.4 ms
    • sync.workspace 8 of 24, Redis, starts at 1,140 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 1,144 ms, lasts 60 ms
      • SET search-index, Redis, starts at 1,208 ms, lasts 0.4 ms
    • sync.workspace 9 of 24, API, starts at 1,300 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 1,304 ms, lasts 60 ms
      • SET search-index, Redis, starts at 1,368 ms, lasts 0.4 ms
    • sync.workspace 10 of 24, Postgres, starts at 1,460 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 1,464 ms, lasts 60 ms
      • SET search-index, Redis, starts at 1,528 ms, lasts 0.4 ms
    • sync.workspace 11 of 24, API, starts at 1,620 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 1,624 ms, lasts 60 ms
      • SET search-index, Redis, starts at 1,688 ms, lasts 0.4 ms
    • sync.workspace 12 of 24, Postgres, starts at 1,780 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 1,784 ms, lasts 60 ms
      • SET search-index, Redis, starts at 1,848 ms, lasts 0.4 ms
    • sync.workspace 13 of 24, Redis, starts at 1,940 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 1,944 ms, lasts 60 ms
      • SET search-index, Redis, starts at 2,008 ms, lasts 0.4 ms
    • sync.workspace 14 of 24, API, starts at 2,100 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 2,104 ms, lasts 60 ms
      • SET search-index, Redis, starts at 2,168 ms, lasts 0.4 ms
    • sync.workspace 15 of 24, Postgres, starts at 2,260 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 2,264 ms, lasts 60 ms
      • SET search-index, Redis, starts at 2,328 ms, lasts 0.4 ms
    • sync.workspace 16 of 24, API, starts at 2,420 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 2,424 ms, lasts 60 ms
      • SET search-index, Redis, starts at 2,488 ms, lasts 0.4 ms
    • sync.workspace 17 of 24, Postgres, starts at 2,580 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 2,584 ms, lasts 60 ms
      • SET search-index, Redis, starts at 2,648 ms, lasts 0.4 ms
    • sync.workspace 18 of 24, Redis, starts at 2,740 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 2,744 ms, lasts 60 ms
      • SET search-index, Redis, starts at 2,808 ms, lasts 0.4 ms
    • sync.workspace 19 of 24, API, starts at 2,900 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 2,904 ms, lasts 60 ms
      • SET search-index, Redis, starts at 2,968 ms, lasts 0.4 ms
    • sync.workspace 20 of 24, Postgres, starts at 3,060 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 3,064 ms, lasts 60 ms
      • SET search-index, Redis, starts at 3,128 ms, lasts 0.4 ms
    • sync.workspace 21 of 24, API, starts at 3,220 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 3,224 ms, lasts 60 ms
      • SET search-index, Redis, starts at 3,288 ms, lasts 0.4 ms
    • sync.workspace 22 of 24, Postgres, starts at 3,380 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 3,384 ms, lasts 60 ms
      • SET search-index, Redis, starts at 3,448 ms, lasts 0.4 ms
    • sync.workspace 23 of 24, Redis, starts at 3,540 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 3,544 ms, lasts 60 ms
      • SET search-index, Redis, starts at 3,608 ms, lasts 0.4 ms
    • sync.workspace 24 of 24, API, starts at 3,700 ms, lasts 140 ms
      • SELECT documents WHERE workspace_id = $1, Postgres, starts at 3,704 ms, lasts 60 ms
      • SET search-index, Redis, starts at 3,768 ms, lasts 0.4 ms

Scrolling

Give the list a height and a long trace scrolls under its axis, which stays in view.

GET /api/projects

Trace 9a04e7c1 · 16 Nov, 14:35:52
SpanDuration

Loading

loading shows rows that wait for the spans, after a moment and for long enough to read.

Installation

npx shadcn@latest add https://kinoui.com/r/waterfall.json
Files
lib/announce.tsxlib/reduce-motion.tslib/scroll.tslib/refs.tslib/resize.tslib/swap.tsxlib/popup.tslib/glide.tsxcomponents/kino/tooltip.tsxlib/cut.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxlib/chart-math.tslib/controllable.tslib/number-format.tslib/chart-core.tsxlib/run-progress.tslib/highlight.tslib/notice.tsxlib/placeholder.tslib/roll.tsxcomponents/kino/collapsible.tsxcomponents/kino/separator.tsxlib/menu.tsxlib/pick.tscomponents/kino/tree.tsxcomponents/kino/waterfall.tsx
Packages
@base-ui/reactclass-variance-authorityd3-array

New to Kino? Installation covers what your project needs first and the @kino namespace.

The CLI keeps any of these colours your project already has, such as the chart colours shadcn init writes. To use Kino’s, set them in your global CSS:

globals.css
:root {  --chart-1: oklch(0.62 0.16 250);  --chart-2: oklch(0.54 0.18 257);  --chart-3: oklch(0.47 0.21 263);  --chart-4: oklch(0.4 0.19 268);  --chart-5: oklch(0.33 0.15 272);}.dark {  --chart-1: oklch(0.82 0.09 245);  --chart-2: oklch(0.74 0.13 250);  --chart-3: oklch(0.67 0.17 257);  --chart-4: oklch(0.61 0.19 263);  --chart-5: oklch(0.55 0.2 268);}

API reference

Waterfall

PropTypeDefaultDescription
durationnumberNoneHow long the trace lasts, in the units of the spans’ start and duration. The axis ends there.
configChartConfigNoneEach kind of span by its kind: its label and color, as a chart’s series. Without a colour, a kind takes the next of --chart-1 to --chart-5.
formatIntl.NumberFormatOptions(value: number) => string{ style: 'unit', unit: 'millisecond', maximumFractionDigits: 1 }How times are written, on the axis, the rows and the tooltip.
localeIntl.LocalesArgumentNoneThe locale times are written in; the page’s by default.
entrance'none''cascade''none'How the bars arrive the first time the Waterfall comes into view: already there, or drawn from their starts in the order the spans ran. None by default, since a page that loads doesn’t animate into place.
hiddenKindsstring[]NoneThe kinds whose bars show only their outline, when you hold the state. With defaultHiddenKinds and onHiddenKindsChange.
messagesPartial<WaterfallMessages>NoneWhat it writes and says, for a page in another language: the headings, how a span’s times are read, and the loading and empty messages.

WaterfallList

PropTypeDefaultDescription
loadingbooleanfalseShows rows that wait for the spans, after a moment and for long enough to read, and says when they arrive.

WaterfallSpan

PropTypeDefaultDescription
valuestringNoneNames the span in expanded and value; unique in the list.
labelReactNodeNoneIts name. Typing a name moves to the span it starts.
startnumberNoneWhen it starts, from the trace’s start.
durationnumberNoneHow long it lasts.
kindstringNoneA key of the Waterfall’s config, which colours its bar.
errorbooleanReactNodeNoneIt failed: true, or what went wrong. Its bar turns the destructive colour, an icon shows beside its name, and its tooltip and its name say what happened.
iconReactNodeNoneShown before the name, sized by the row.

Data attributes

AttributeOnDescription
data-litA span’s rowThe span under the pointer, the focus or a touch.
data-dimA barIt steps back while a kind is brought forward from the legend.
data-hiddenA barIts kind is turned off in the legend: it shows only its outline.
data-errorA barIts span failed.

CSS variables

VariableSet it onDefaultDescription
--waterfall-dimWaterfall, or anything above it0.3How much colour a bar that steps back keeps. It keeps its lightness, so it keeps its contrast.
--waterfall-cascadeWaterfall, or anything above it0.6How much of one draw the latest span waits before it draws, as a branch opens or with entrance='cascade'. Every span settles within one draw.
--waterfall-name-widthWaterfall, or anything above it24remThe most room the names take before the bars’ column; the bars always keep half the list.
--waterfall-radiusWaterfall, or anything above itvar(--control-radius-xs)A bar’s corner, never more than half its thickness.
--waterfall-min-lengthWaterfall, or anything above it2pxThe least length of a bar, so a span too short to see still shows.

Accessibility

  • The list is the WAI-ARIA tree pattern, through Kino’s Tree: it is one stop in the tab order; Up and Down move between the spans that show, Right opens a span and Left closes it or goes to its parent, Home and End go to the ends, and typing a name goes to the span it starts.
  • Each span’s name says its kind, when it starts, how long it lasts and, when it failed, what went wrong; the bar and the axis are hidden from screen readers.
  • A failed span shows an icon beside its name as well as its colour, and a hidden kind keeps an outline that forced colours keep too.
  • Loading, the spans arriving and an empty trace are announced in a status region.
  • A touch on a span lights it and opens its tooltip, as the pointer does.
  • When the system asks for less motion, bars fade in where they are and nothing slides.