shadcn.io is not affiliated with official shadcn/ui
Endpoint Latency Range Stats Block for React
A gateway usage table where each route shows calls, error rate, a p50-to-p99 latency range on one scale, and a bar for its share of the rate limit.
Installation
Overview
A route table for React with Base UI. Routewick, an API gateway, reports the last 24 hours: a start-aligned header counts how many routes sit over a 1% error line, with the call total at the end of the row. Under it, one framed table lists each path in monospace, its calls, its error rate, a latency range that runs from p50 to p99 on a shared scale of 0 to 1,000 ms (ticks at p50, p95 and p99), and a bar for the share of that route's limit. The one route over 1% carries a destructive status and the words "Over 1%". Below md the latency range and the limit leave the table, and a line under the path keeps the p99 and the share of the limit. Every rate, share and headline is computed from the same rows. It's built from Table, Progress, Status and Guides, with the bars in your theme's foreground colour.
FAQ
How do I change the routes?
Edit ROUTES at the top of the file. A route has a path, calls, errors, a limit, and p50, p95 and p99 in milliseconds. SCALE is the shared latency scale (1,000 ms) and ALERT_AT is the error rate, in percent, from which a route is called out. The headline, the rates, the range and each share of the limit are all read from those rows.
How does the latency range work?
Every route is drawn on the same scale, 0 to 1,000 ms. The bar starts at p50 and ends at p99, and three ticks mark p50, p95 and p99. The numbers under the bar are the same milliseconds the ticks use, so the drawing and the text can't disagree.
Why isn't a high error rate coloured red?
The rate stays in the text colour. The one route over 1% is marked with a destructive status and the words "Over 1%", so the alert is not carried by colour alone and it still reads in every theme, light or dark.
Is the table accessible?
Yes. The table is named ("Gateway routes for the last 24 hours"), each column has a header, and the path is the row header. The range is decorative because the p50, p95 and p99 are written out beside it. The limit bar is named with the calls, the limit and the share. The status icon is hidden from assistive technology because "Over 1%" says the same. Values sit in bdi elements, and paths are kept left to right.
The bar takes an aria-label. The table is a native table. When it is wider than the frame, Tab reaches the scroll region and the arrow keys scroll it.
How does it fit on a phone?
The rate-limit column drops out below lg and the latency range below md. The error rate stays, and a line under the path keeps that route's share of the limit (and, on a phone, its p99), so those numbers are not lost. Nothing in the remaining columns needs a sideways scroll at 320 pixels.
Related
- Pro
A background-job table where each queue's depth is a bar split into waiting, running and retrying, with the backlog total in the header.
- Pro
Quota Tile Grid Stats
Goals and progressSix plan-quota tiles (seats, API calls, storage, projects, bandwidth, builds) with used against limit, a bar, what is left and a reset hint in days; a tile at 90% or more gets a solid bar and an Upgrade link badge.
- Pro
Percentile Markers Histogram Stats
DistributionsSixteen latency bins in a neutral fill with vertical markers at the median, the 95th and the 99th percentile, labelled at alternating heights, and a list of the three values in the header.
- Pro
Rate Limit Table Stats
TablesA framed table of API endpoints with method badges, calls used against each limit, a bar with a tick at the 80% line and a countdown to each window's reset.
- Pro
A log-analytics table of five severity levels with the count, the lines a minute, and a bar whose length is the logarithm of the count, plus a filter that dims the quieter levels.
- Pro
Cohort Retention Table Stats
HeatmapsA triangular retention table of six weekly signup cohorts by months M0 to M5, a percent in every cell in five foreground steps, an average row at the foot and the month-one average in the header.