GodUI

Resizable Header

A sticky navbar that springs into a compact, blurred floating pill as you scroll, with a shared-element active indicator.

northwind.com

Ship faster with Northwind

Scroll this panel — the navigation springs into a compact, blurred pill and the active link indicator follows along.

Analytics
Automations
Integrations
Security

Installation

pnpm dlx shadcn@latest add "https://godui.design/r/resizable-header.json"

Usage

tsx
 
import { ResizableHeader } from "@/components/godui/resizable-header";
tsx
 
const links = [
  { label: "Product", href: "/product" },
  { label: "Pricing", href: "/pricing" },
  { label: "Docs", href: "/docs" },
];

<ResizableHeader links={links} activeHref={pathname} onNavigate={router.push} />;

By default the header tracks window scroll. To track a scroll container instead (as in the preview above), pass a scrollRef:

tsx
 
const scrollRef = useRef(null);

<div ref={scrollRef} className="overflow-y-auto">
  <ResizableHeader scrollRef={scrollRef} links={links} />
  {/* content */}
</div>;

Props

PropTypeDefaultDescription
logoReactNode"GodUI"Brand mark on the left
linksHeaderLink[][]Navigation links: { label, href }
activeHrefstringhref of the active link
ctaReactNodeCall-to-action node on the right
scrollThresholdnumber24Scroll px before the bar morphs to a pill
stickybooleantrueStick the header to the top
scrollRefRefObject<HTMLElement>Scroll container to track (defaults to window)
onNavigate(href: string) => voidCalled on link click (prevents default)

On this page

Built with GodUI

Beautifully crafted motion components for modern interfaces.

Star on GitHub