Overhanging Logo & Mega Menu Header
Full-width sticky product header with your real sticker logo hanging over the bottom edge at -3deg (it straightens on hover), anchored mega menus with icons and a featured callout, and a slide-down menu on tablet and mobile. Swap the logo in one prop.
Install UI SDK & packages
npm install @ui-sdk/react @ui-sdk/core lucide-react
Give your agent the UI SDK skill
npx skills add vercel-labs/ui --skill ui-sdk
"use client"; import * as React from "react"; import { ArrowRight, Blocks, ChevronDown, History, LayoutDashboard, LifeBuoy, Menu, MessageSquare, Plug, Terminal, X, } from "lucide-react"; import type { LucideIcon } from "lucide-react"; import { Button } from "@ui-sdk/react/button"; import { Drawer, DrawerBackdrop, DrawerClose, DrawerContent, DrawerTitle, DrawerTrigger, } from "@ui-sdk/react/drawer"; import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, } from "@ui-sdk/react/navigation-menu"; export interface HeaderLink { title: string; href: string; description?: string; icon?: LucideIcon; badge?: string; } export interface HeaderFeatured { title: string; description: string; href: string; cta: string; } /** A section with `links` opens a mega menu. A section with only `href` is a plain link. */ export interface HeaderSection { label: string; href?: string; current?: boolean; links?: HeaderLink[]; featured?: HeaderFeatured; } export interface HeaderCta { label: string; href: string; } export interface OverhangingMegaHeaderProps { /** Swap this one line to use your own sticker logo. */ logoSrc?: string; logoAlt?: string; homeHref?: string; sections?: HeaderSection[]; primaryCta?: HeaderCta; secondaryCta?: HeaderCta | null; /** Pass your router's push to navigate without a full page load. */ onNavigate?: (href: string) => void; } const DEFAULT_SECTIONS: HeaderSection[] = [ { label: "Products", links: [ { title: "OverPlan", description: "Map every screen before you build.", href: "https://overplan.wynter.ai", icon: LayoutDashboard }, { title: "Template Factory", description: "Turn screenshots into ready-to-use templates.", href: "https://templatefactory.wynter.ai", icon: Blocks, badge: "Mac" }, { title: "Snow", description: "App components your coding agent can use.", href: "https://snow.wynter.ai", icon: Plug }, { title: "FeedbackAI", description: "Collect feedback and answer questions in one widget.", href: "https://feedback.wynter.ai", icon: MessageSquare }, ], featured: { title: "Connect once, use everywhere", description: "Add Snow to Claude Code, Cursor, or Codex in about a minute.", href: "/mcp-docs", cta: "Set up Snow", }, }, { label: "Resources", links: [ { title: "Help Center", description: "Step-by-step guides with real screenshots.", href: "/help", icon: LifeBuoy }, { title: "Setup guide", description: "Connect your coding tools in one step.", href: "/mcp-docs", icon: Terminal }, { title: "What's new", description: "Recent launches and weekly drops.", href: "/changelog", icon: History }, ], }, { label: "Library", href: "/library" }, { label: "Pricing", href: "/pricing" }, ]; const btnBase = "inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-[10px] font-bold transition hover:-translate-y-px active:translate-y-px disabled:pointer-events-none disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-500"; const btnMd = "h-11 px-4 text-sm"; const btnSm = "h-9 px-3 text-[13px]"; const btnPrimary = `${btnBase} border border-sky-300/60 bg-linear-to-b from-sky-300 via-sky-400 to-sky-600 text-[#031521] shadow-[inset_0_1px_0_rgba(255,255,255,0.55),inset_0_-2px_0_rgba(3,55,86,0.35),0_8px_20px_rgba(2,132,199,0.25)] hover:brightness-105`; const btnGhost = `${btnBase} border border-slate-300 bg-linear-to-b from-white to-slate-100 text-slate-900 shadow-[inset_0_1px_0_rgba(255,255,255,0.95),inset_0_-1.5px_0_rgba(15,23,42,0.08),0_1px_2px_rgba(15,23,42,0.06)] hover:border-slate-400 dark:border-slate-400/35 dark:from-[#243047] dark:to-[#182234] dark:text-slate-50 dark:shadow-[inset_0_1px_0_rgba(255,255,255,0.09),inset_0_-1.5px_0_rgba(0,0,0,0.35)] dark:hover:border-slate-400/55`; const navLink = "inline-flex h-[38px] cursor-pointer items-center gap-1.5 rounded-[9px] px-3 text-sm font-semibold text-slate-600 transition-colors hover:bg-slate-900/[0.06] hover:text-slate-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-500 data-current:bg-slate-900/[0.06] data-current:text-slate-900 data-open:bg-slate-900/[0.06] data-open:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-400/[0.12] dark:hover:text-slate-50 dark:data-current:bg-slate-400/[0.12] dark:data-current:text-slate-50 dark:data-open:bg-slate-400/[0.12] dark:data-open:text-slate-50"; const megaLink = "flex items-start gap-3 rounded-[10px] p-2.5 transition-colors hover:bg-slate-900/[0.06] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-500 dark:hover:bg-slate-400/[0.12]"; const popover = "rounded-2xl border border-slate-300 bg-white shadow-[0_24px_60px_rgba(15,23,42,0.2)] dark:border-slate-400/35 dark:bg-[#111827] dark:shadow-[0_28px_70px_rgba(0,0,0,0.62)]"; function LinkBody({ link }: { link: HeaderLink }) { const Icon = link.icon; return ( <> {Icon && ( <span className="grid h-9 w-9 shrink-0 place-items-center rounded-[9px] bg-sky-600/10 text-sky-700 dark:bg-sky-400/15 dark:text-sky-300"> <Icon className="h-[18px] w-[18px]" aria-hidden="true" /> </span> )} <span className="min-w-0"> <span className="flex items-center gap-2 text-sm font-semibold text-slate-900 dark:text-slate-50"> {link.title} {link.badge && ( <span className="rounded-full border border-slate-300 bg-slate-50 px-2 py-0.5 text-[11px] font-bold leading-none text-slate-700 dark:border-slate-400/35 dark:bg-[#162033] dark:text-slate-200"> {link.badge} </span> )} </span> {link.description && ( <span className="mt-0.5 block text-[12.5px] leading-snug text-slate-600 dark:text-slate-400">{link.description}</span> )} </span> </> ); } export function OverhangingMegaHeader({ logoSrc = "/brand/snow-logo.webp", logoAlt = "Snow", homeHref = "/", sections = DEFAULT_SECTIONS, primaryCta = { label: "Open workspace", href: "/app" }, secondaryCta = { label: "Sign in", href: "/auth/wynter" }, onNavigate, }: OverhangingMegaHeaderProps) { const [menuOpen, setMenuOpen] = React.useState(false); const go = (href: string) => (event: React.MouseEvent<HTMLElement>) => { setMenuOpen(false); if (!onNavigate) return; event.preventDefault(); onNavigate(href); }; return ( <header className="sticky top-0 z-40 border-b border-[#d8e0ea] bg-white/90 backdrop-blur-xl dark:border-slate-400/20 dark:bg-[#111827]/90"> <div className="mx-auto flex h-[60px] max-w-6xl items-center gap-3 px-4 sm:h-16 sm:gap-4 sm:px-6"> <a href={homeHref} onClick={go(homeHref)} aria-label={`${logoAlt} home`} className="group relative top-[11px] z-10 inline-flex shrink-0 self-start rounded-xl focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-sky-500 sm:top-[13px]" > <img src={logoSrc} alt={logoAlt} className="h-[54px] w-auto origin-top-left -rotate-3 drop-shadow-[0_8px_14px_rgba(15,23,42,0.3)] transition-transform duration-500 ease-out group-hover:rotate-0 group-focus-visible:rotate-0 motion-reduce:transition-none sm:h-[62px] dark:drop-shadow-[0_10px_18px_rgba(2,132,199,0.34)]" /> </a> <NavigationMenu aria-label="Primary navigation" className="ml-2 hidden lg:block"> <NavigationMenuList className="flex items-center gap-0.5"> {sections.map((section) => section.links && section.links.length > 0 ? ( <NavigationMenuItem key={section.label} value={section.label}> <NavigationMenuTrigger className={`group ${navLink}`}> <span>{section.label}</span> <ChevronDown className="h-3.5 w-3.5 transition-transform group-data-open:rotate-180" aria-hidden="true" /> </NavigationMenuTrigger> <NavigationMenuContent side="bottom" align="start" sideOffset={14} className={`z-50 p-2.5 ${popover} ${section.featured ? "w-[min(700px,calc(100vw-2rem))]" : "w-[min(380px,calc(100vw-2rem))]"}`} > <div className={section.featured ? "grid gap-2.5 sm:grid-cols-[minmax(0,1fr)_208px]" : undefined}> <ul className={`grid content-start gap-0.5 ${section.featured ? "sm:grid-cols-2" : ""}`}> {section.links.map((link) => ( <li key={link.title}> <NavigationMenuLink href={link.href} onClick={go(link.href)} className={megaLink}> <LinkBody link={link} /> </NavigationMenuLink> </li> ))} </ul> {section.featured && ( <div className="flex flex-col gap-2 rounded-xl bg-slate-50 p-3.5 dark:bg-[#162033]"> <p className="text-sm font-semibold leading-snug text-slate-900 dark:text-slate-50">{section.featured.title}</p> <p className="text-[12.5px] leading-snug text-slate-600 dark:text-slate-400">{section.featured.description}</p> <NavigationMenuLink href={section.featured.href} onClick={go(section.featured.href)} className={`${btnGhost} ${btnSm} mt-auto`} > <span>{section.featured.cta}</span> <ArrowRight className="h-3.5 w-3.5" aria-hidden="true" /> </NavigationMenuLink> </div> )} </div> </NavigationMenuContent> </NavigationMenuItem> ) : ( <NavigationMenuItem key={section.label}> <NavigationMenuLink href={section.href ?? "#"} current={section.current} onClick={go(section.href ?? "#")} className={navLink} > {section.label} </NavigationMenuLink> </NavigationMenuItem> ), )} </NavigationMenuList> </NavigationMenu> <div className="ml-auto flex shrink-0 items-center gap-2"> {secondaryCta && ( <Button render={<a href={secondaryCta.href} />} onClick={go(secondaryCta.href)} className={`${btnGhost} ${btnSm} hidden lg:inline-flex`} > {secondaryCta.label} </Button> )} <Button render={<a href={primaryCta.href} />} onClick={go(primaryCta.href)} className={`${btnPrimary} ${btnSm} hidden sm:inline-flex`} > <span>{primaryCta.label}</span> <ArrowRight className="h-3.5 w-3.5" aria-hidden="true" /> </Button> <Drawer side="top" open={menuOpen} onOpenChange={setMenuOpen}> <DrawerTrigger aria-label="Open menu" className={`${btnGhost} h-11 w-11 lg:hidden`}> <Menu className="h-5 w-5" aria-hidden="true" /> </DrawerTrigger> <DrawerBackdrop className="fixed inset-0 z-50 bg-slate-900/40 dark:bg-black/65" /> <DrawerContent className="z-50 max-h-[88dvh] w-full overflow-y-auto border-b border-slate-300 bg-white px-4 pb-5 pt-3 shadow-[0_24px_60px_rgba(15,23,42,0.2)] dark:border-slate-400/35 dark:bg-[#111827] dark:shadow-[0_28px_70px_rgba(0,0,0,0.62)]"> <div className="flex items-center justify-between"> <DrawerTitle className="text-base font-bold text-slate-900 dark:text-slate-50">Menu</DrawerTitle> <DrawerClose aria-label="Close menu" className={`${btnGhost} h-11 w-11`}> <X className="h-5 w-5" aria-hidden="true" /> </DrawerClose> </div> <nav aria-label="Mobile navigation" className="mt-2"> {sections.map((section, index) => section.links && section.links.length > 0 ? ( <details key={section.label} open={index === 0} className="group border-b border-[#d8e0ea] dark:border-slate-400/20"> <summary className="flex min-h-12 cursor-pointer list-none items-center justify-between text-[15px] font-semibold text-slate-900 dark:text-slate-50 [&::-webkit-details-marker]:hidden"> <span>{section.label}</span> <ChevronDown className="h-4 w-4 text-slate-600 transition-transform group-open:rotate-180 dark:text-slate-400" aria-hidden="true" /> </summary> <ul className="grid gap-0.5 pb-2"> {section.links.map((link) => ( <li key={link.title}> <a href={link.href} onClick={go(link.href)} className={megaLink}> <LinkBody link={link} /> </a> </li> ))} </ul> </details> ) : ( <a key={section.label} href={section.href ?? "#"} onClick={go(section.href ?? "#")} aria-current={section.current ? "page" : undefined} className="flex min-h-12 items-center border-b border-[#d8e0ea] text-[15px] font-semibold text-slate-900 dark:border-slate-400/20 dark:text-slate-50" > {section.label} </a> ), )} </nav> <div className="mt-4 grid gap-2.5 sm:grid-cols-2"> {secondaryCta && ( <a href={secondaryCta.href} onClick={go(secondaryCta.href)} className={`${btnGhost} ${btnMd}`}> {secondaryCta.label} </a> )} <a href={primaryCta.href} onClick={go(primaryCta.href)} className={`${btnPrimary} ${btnMd}`}> <span>{primaryCta.label}</span> <ArrowRight className="h-4 w-4" aria-hidden="true" /> </a> </div> </DrawerContent> </Drawer> </div> </div> </header> ); } export default OverhangingMegaHeader;
More in Navigation & Shells
App Topbar with Multi-Stop Theme & Accent Picker
MSAI app topbar separating global room brightness (4 hand-tuned stops: Midnight, Dim, Paper, Bright) from per-workspace accent hue (13 swatches + custom picker), paired with a live credits balance pill and global Help-mode switch.
Nested Workspace & Docked Section Nav
Two-column app navigation shell extracted from MSAI: a collapsible left rail with workspace switcher, primary nav, time-bucketed scheduled items, and expandable project folders beside a docked Level-1/Level-2 SectionNav column that folds down to a clickable 11px edge strip.
Collapsible App Workspace Shell
Full-height app workspace that never scrolls the page: collapsible sidebar with your icon mark, workspace switcher, solid-fill active nav, breadcrumb top bar with quick search and account menu, and a slide-over sidebar on tablet and mobile.