Staaarter

Performance Waterfall

A network request waterfall chart listing a page load's requests with their method, a cascading bar showing timing offset and duration positioned within a fixed-width track, and the numeric duration in milliseconds. Bars are colored by a fast/medium/slow duration bucket with a small legend above the chart. Built for performance reports and debugging guides.

By Staaarter Team
DevTools
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/performance-waterfall.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/devtools/devtools5.tsx instead.

Usage

The file also exports devtools5Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Devtools5, devtools5Demo } from "@/components/blocks/devtools/devtools5";

export default function Page() {
  return <Devtools5 {...devtools5Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Performance Waterfall"Section heading.
descriptionstringundefinedSection intro text below the heading.
requestsWaterfallRequest[][]Request rows rendered top to bottom in the order given.
classNamestringnoneExtra classes for the outer section element.

Types

type WaterfallRequest = {
  name: string;
  method: string;
  offsetPercent: number;
  durationPercent: number;
  durationMs: number;
};

Behavior notes

  • Entirely static; no client-side interactivity, and no real network measurement. offsetPercent and durationPercent are fixed literals positioned with inline marginLeft/width styles against a fixed-width track.
  • Bar color is derived from durationMs at render time (fast <100ms=emerald, medium 100-500ms=amber, slow >500ms=red) via plain arithmetic, not from a separate bucket prop, so color always stays in sync with the displayed duration.
  • offsetPercent and durationPercent are independent of durationMs; the caller is responsible for keeping the visual bar roughly proportional to the numeric value, the component does not compute one from the other.
  • The request name column has a fixed width and truncates long paths with an ellipsis rather than wrapping, to keep every bar's track aligned.