Loading Bar
Shows a line along the window's top while a slow page loads.
<LoadingBar aria-label="Loading page" loading={loading} />Installation
$ npx shadcn@latest add @constella/loading-barUsage
import { LoadingBar } from "@/components/primitives/loading-bar";<LoadingBar aria-label="Loading page" loading={loading} />Render one at the root of the app and set loading while a page loads. It shows only once a load outlasts 150ms, so a fast one never flashes, then creeps toward its end until loading turns false.
Router
Pass the router's loading state to loading. With TanStack Router, read it with useRouterState in the root route.
import { useRouterState } from "@tanstack/react-router";
function RouteLoadingBar() { const loading = useRouterState({ select: (state) => state.isLoading }); return <LoadingBar aria-label="Loading page" loading={loading} />;}API Reference
LoadingBar
Takes every prop of Base UI Progress's root except value, plus:
It renders a progressbar with no value. Name it with aria-label.