Componentnavigation0.35 KB gzipZero dependencies

Route Loader

Minimal top progress loader bar with smooth transit animation.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add route-loader

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { RouteLoader } from "@/components/ui/route-loader"; <RouteLoader active={true} />

Source code

route-loader.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxroute-loader.tsx24 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface RouteLoaderProps extends React.HTMLAttributes<HTMLDivElement> {  /** Visible progress bar animation during route transitions */  active: boolean;} /** Route progress bar: top micro loading indicator. */export function RouteLoader({ active, className, ...props }: RouteLoaderProps) {  return (    <div      className={cn("fixed inset-x-0 top-0 z-[60] h-0.5 overflow-hidden transition-opacity duration-200 motion-reduce:transition-none", active ? "opacity-100" : "opacity-0", className)}      role="progressbar"      aria-label="Page loading"      {...props}    >      {active && <div className="h-full w-full bg-accent motion-reduce:animate-none!" style={{ animation: "rlRun 1.2s ease-in-out infinite" }} />}    </div>  );} 

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { RouteLoader } from "@/components/ui/route-loader"; <RouteLoader />
PropTypeDescription
activebooleanVisible progress bar animation during route transitions