A top-of-page progress bar that shows during route navigation
Click the button to simulate a page navigation
{ progress: "0%" }Automatically shows on route changes
{ trigger: "auto" }Handles navigation completion gracefully
{ completion: "smart" }Adapts to any screen width
{ width: "100vw" }Optimized for smooth animations
{ performance: "optimized" }import { NavigationProgress } from "@/components/ui/navigation-progress";// app/layout.tsx
export default function RootLayout({ children }) {
return (
<html>
<body>
<Suspense fallback={null}>
<NavigationProgress />
</Suspense>
{children}
</body>
</html>
);
}// Dispatch custom event before programmatic navigation
window.dispatchEvent(new Event('navigationStart'));
router.push('/new-page');.navigation-progress-containerFixed container at top of viewport (27px height, z-index: 99999).navigation-progress-barProgress bar with background image (loading.png), right-aligned.fade-outApplied during fade-out animation (opacity: 0, 300ms transition)