204 Pro components and page blocks

Get Pro

Updated

Request Waterfall

New

Preview

Customize

Color
Width640px

Installation

npx shadcn@latest add https://uibrik.com/r/request-waterfall.json
Adds the files to components/uibrik/request-waterfall and installs @tabler/icons-react and motion. With the @uibrik namespace set up: npx shadcn@latest add @uibrik/request-waterfall.

Usage

import { RequestWaterfall } from "@/components/uibrik/request-waterfall/request-waterfall";​const requests = [  { name: "acme.shop", type: "document", size: 18400, start: 0, status: 200, phases: { dns: 28, connect: 34, tls: 46, waiting: 142, download: 18 } },  { name: "app.css", type: "style", size: 32800, start: 276, status: 200, phases: { queued: 4, waiting: 58, download: 22 } },  // …10 more];​const markers = [  { label: "DOMContentLoaded", time: 612 },  { label: "Load", time: 1184 },];​<RequestWaterfall  title="Network"  color="#2f7cf6"  showSize  width={640}  requests={requests}  markers={markers}  defaultOpen={null}  // open={0}  // onOpenChange={(index) => {}}/>

Where to use Request Waterfall

  • Performance and observability tools

    Phases that pull apart on hover show where a request spent its time without a separate panel.

    Pairs with Stack Trace

  • Developer tool landing pages

    A waterfall that draws itself in explains page loading in a few seconds.

    Pairs with Performance Meter

  • API and CDN dashboards

    Markers for DOMContentLoaded and Load put every request in the context of the page.

Props

RequestWaterfall
title
Type string
"Network"
Heading above the totals.
color
Type string
"#2f7cf6"
Colour the phases are shaded from.
showSize
Type boolean
true
Show transfer sizes when there is room.
width
Type number
640
Width of the card; never wider than its container.
requests
Type { name: string; type: string; size?: number; start: number; status?: number; phases: { queued?, dns?, connect?, tls?, waiting?, download?: number } }[]
–
One row per request. start and phases are in ms; statuses of 400 and up are marked.
markers
Type { label: string; time: number }[]
–
Dashed lines across the rows, e.g. DOMContentLoaded and Load.
open / onOpenChange
Type number | null / (index) => void
–
Index of the open row, controlled.
defaultOpen
Type number | null
null
Open row on mount when uncontrolled.
className
Type string
–
Classes for the wrapper.