Progress Bar
Thin page-level progress indicator for navigation and loading.
Installation
bun add @xerobi/ui
import { ProgressBar } from "@xerobi/ui/progress-bar"This component is client-side. In Astro, hydrate it with a client directive.
API reference
ProgressBar
| Prop | Type | Description |
|---|---|---|
| loading | boolean | Start while true, finish when it turns false. |
| value | number | Controlled 0-100 value. Overrides `loading` when set. |
Hooks
useProgressBar: Drives a top-of-page loading bar. Call `start()` when navigation or a request begins and `done()` when it ends; the bar trickles toward 90% in between. Works with any router.