Skip to content

HorizontalBar

One value per category, with the names on the left where long names fit: the slowest endpoints, storage by table. Sorted from the largest.

import { HorizontalBar, RowsChartSkeleton } from '@sypnia/ui/react'

On this page
  1. Slowest endpoints, and the skeleton
  2. When to use it
  3. For everyone
  4. Props

Slowest endpoints, and the skeleton

Slowest endpoints
Time to answer, 95th percentile
  • GET /orders?include=items840 ms
  • POST /checkout620 ms
  • GET /products/search410 ms
  • POST /login180 ms
  • GET /me95 ms
View as table
Endpoint
GET /orders?include=items840 ms
POST /checkout620 ms
GET /products/search410 ms
POST /login180 ms
GET /me95 ms
Code
import { HorizontalBar, RowsChartSkeleton } from '@sypnia/ui/react';

// Long names fit on the left; sorted from the slowest.
export default function Endpoints() {
  return (
    <div className="sy-stack">
      <HorizontalBar title="Slowest endpoints" subtitle="Time to answer, 95th percentile" label="Endpoint" formatValue={(v) => `${v} ms`}
        items={[{ label: 'GET /orders?include=items', value: 840 }, { label: 'POST /checkout', value: 620 }, { label: 'GET /products/search', value: 410 }, { label: 'GET /me', value: 95 }, { label: 'POST /login', value: 180 }]} />
      <RowsChartSkeleton rows={3} />
    </div>
  );
}

When to use it

Use it when

  • Rankings and categories with long names.

Do not use it when

  • Values over time: use BarChart or LineChart.

For everyone

  • Each row is focusable and named with its label and value.
  • On phones the bar goes under the name, full width.

Props

HorizontalBarTypeDefault
itemsrequired { label: string; value: number; }[]
titlerequired ReactNode
empty ReactNode
error ReactNode
formatValue Fmt
height number
keepOrder boolean
label

The header of the first column of the table view.

string Name
loading boolean
loadingRows

On the first load (`loading` with no items): how many rows will come, drawn as rows of skeleton. Default 5.

number
subtitle ReactNode
RowsChartSkeletonTypeDefault
rows number 5
  1. Slowest endpoints, and the skeleton
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms