Holdbar
Holdbar(props: HoldbarProps): JSX.ElementThis is the bar your whole page shares. Render Holdbar once near the root; it does not wrap your app or add a layout element. Its props are optional.
The stylesheet draws the visible line with ::before and currentColor, so it fits your design through the color and styles you already use. Every Holdbar on the page reflects the same state, which is why one is enough.
Holdbar also works from Server Components. The server starts in idle; browser-specific behavior stays in the client components inside it.
props
heightnumberdefault 2Set the bar height in pixels. This writes to
--holdbar-height; without it, the stylesheet uses2pxor your own CSS value.fillDurationnumberdefault 12000Set how long the fill takes to reach 90% width. This is an animation, not a progress measurement: it moves quickly at first, slows down, then waits at 90% for the final hold.
minVisiblenumberdefault 0Give the bar a minimum on-screen time in milliseconds. If the work finishes sooner, it waits before finishing. At
0, a quick task still gets the full finish animation, so the bar does not flash.detachFromViewTransitionbooleandefault falseKeep the bar in place at the top while the page changes in a view transition. It gets its own
view-transition-name....restComponentProps<"div">Other props go to the
div, includingclassName,style,id, data attributes andref. YourstyleandonAnimationEndare preserved.