Latency Badge

A monospace millisecond badge that turns green under 100ms, amber under 400ms and red above. Useful for API monitors, model responses and status dashboards.

src/registry/ui/latency-badge.tsx/r/latency-badge.json

Installation#

bash
npx shadcn@latest add @minidev/latency-badge

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/latency-badge.json

Usage#

tsx
import { LatencyBadge } from "@/components/ui/latency-badge"

export function Example() {
  return (
    <LatencyBadge ms={48} />
  )
}

API reference#

LatencyBadge props
PropTypeDefault
ms*number-
classNamestring-

* required

Examples#

All Developer tool UI components for React

Learn more