Ping Indicator
Four rising bars that show connection quality from a live probe.
—
Installation
Run the following command to install the `ping-indicator` components:
npx shadcn-svelte@latest add https://more-shadcn.noair.fun/r/ping-indicator.json
Levels
Bars light up from the round trip against
thresholds: four under excellent, three under good, two under fair, one above
it, and none when the probe fails. Colour follows the same scale, and the offline state is
labelled in text so it does not rely on colour alone. — Excellent
— Good
— Fair
— Poor
Unreachable
Smoothing
A single slow response should not drop the bars. The indicator keeps the last
smoothing samples and rates the median of them, so the display only moves when
the connection actually changes. Set smoothing={1} to react to every sample.Sizes and labels
Three sizes, an optional
label, and showLatency for the raw number. bars changes how many segments are drawn — the thresholds rescale to match. sm md lg —
Probing and control
With a
url the indicator sends a cache busted HEAD request in no-cors mode, so timing stays accurate without the endpoint needing CORS headers. Pass a probe to time anything else. Polling pauses while the tab is hidden and whenever paused is set. —
Custom rendering
The default snippet receives the status, the number of lit bars and the latest latency, while
the polling keeps running.
latency is also bindable.