Dmitry

Header — Morphing

Navigation

About

Sticky header that shrinks while the page scrolls: padding, logo height and nav spacing follow the scroll position. Pure CSS scroll-driven animations, no JavaScript. Texts and links come through props. From GooseUI (goosen-x/gooseui), MIT.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Header — Morphing to your project and fits it to your theme.

Code

How Header — Morphing is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { HeaderMorphing } from "@/components/ui/gooseui-header-morphing"

/**
 * Демо для блоков, которым нужно окружение: у морфящегося хедера анимация
 * идёт от прокрутки ближайшего скроллера, поэтому кладём его в контейнер с контентом.
 */
export function HeaderMorphingDemo() {
  return (
    <div className="h-[26rem] overflow-y-auto">
      <HeaderMorphing as="div" compactThreshold={80} className="z-10" />
      <div className="space-y-4 p-4">
        <p className="py-6 text-center text-sm text-muted-foreground">
          ↓ Scroll to see the header shrink ↓
        </p>
        {Array.from({ length: 10 }).map((_, i) => (
          <div key={i} className="rounded-lg border bg-background p-4">
            <div className="mb-2 h-4 w-3/4 rounded bg-muted" />
            <div className="h-3 w-1/2 rounded bg-muted/60" />
          </div>
        ))}
      </div>
    </div>
  )
}

export default HeaderMorphingDemo

Dependencies

More by Dmitry

View all
  • Border Beam

    Border Beam

    156
  • Features Grid

    Features Grid

    104
  • Rating

    Rating

    1
  • Tap Coin

    Tap Coin

  • Header — Magazine

    Header — Magazine

  • Header — Mega Menu

    Header — Mega Menu

  • Morphing Header

    Morphing Header

  • Theme Customizer

    Theme Customizer

More in Navigation

View all
  • Footer with Big Wordmark

    Footer with Big Wordmark

    171
  • Liquid Glass Expandable Sidebar

    Liquid Glass Expandable Sidebar

    449
  • Meniscus — Liquid Bottom Navigation Bar

    Meniscus — Liquid Bottom Navigation Bar

    33
  • Sidebar

    Sidebar

    444
  • Stacked Circular Footer

    Stacked Circular Footer

    470
  • Tabs

    Tabs

    38
  • Sidebar

    Sidebar

    367
  • Footer Section

    Footer Section

    3