Navbar Generator
Design production-ready, ultra-responsive modern navigation headers with mega-menus, slide-out mobile drawers, announcement tickers, and clean Tailwind CSS code.
Modern Responsive Architecture
Notice how the navigation adapts to viewports, backdrop refraction, mega-menu subcategories, βK command modal, and mobile slide-out drawers.
import React, { useState, useEffect } from 'react';
export default function NavigationBar() {
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);
const [megaMenuOpen, setMegaMenuOpen] = useState(false);
const [notificationsOpen, setNotificationsOpen] = useState(false);
const [commandPaletteOpen, setCommandPaletteOpen] = useState(false);
const [profileMenuOpen, setProfileMenuOpen] = useState(false);
const [languageOpen, setLanguageOpen] = useState(false);
const [selectedLang, setSelectedLang] = useState('EN');
const [scrolled, setScrolled] = useState(false);
const [announcementDismissed, setAnnouncementDismissed] = useState(false);
useEffect(() => {
const handleScroll = () => {
setScrolled(window.scrollY > 20);
};
window.addEventListener('scroll', handleScroll);
return () => window.removeEventListener('scroll', handleScroll);
}, []);
return (
<div className="w-full">
{/* Top Announcement Ticker Bar */}
{!announcementDismissed && (
<div className="relative bg-gradient-to-r from-indigo-400 via-purple-300 to-pink-400 text-white px-4 py-2 text-xs font-semibold text-center flex items-center justify-center gap-2">
<span>β¨ Introducing Mobiflix AI 3.0 β’ Explore Early Access β</span>
<button
onClick={() => setAnnouncementDismissed(true)}
className="absolute right-3 p-1 rounded-md hover:bg-white/20 text-white/80 hover:text-white transition-colors"
aria-label="Dismiss announcement"
>
β
</button>
</div>
)}
{/* Main Navbar Header */}
<header className="sticky top-0 z-40 transition-all duration-300 max-w-5xl mx-auto px-4 sm:px-6 my-4">
<nav className="rounded-full border border-slate-800 bg-slate-950/85 px-5 backdrop-blur-md backdrop-saturate-150 shadow-2xl text-white transition-all duration-300">
<div className="flex items-center justify-between h-16">
{/* Brand Logo */}
<div className="flex items-center gap-8">
<a href="#" className="flex items-center gap-2.5 font-bold text-sm sm:text-base tracking-tight shrink-0">
<span className="w-8 h-8 rounded-xl bg-gradient-to-tr from-indigo-400 via-purple-300 to-pink-400 flex items-center justify-center shadow-md">
<svg className="w-4 h-4 text-white" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path d="m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"/></svg>
</span>
<span className="font-extrabold">Mobiflix</span>
<span className="hidden lg:inline-flex items-center px-2 py-0.5 rounded-full border border-indigo-500/30 text-indigo-300 bg-indigo-500/10 hover:bg-indigo-500/20 text-[10px] font-semibold">
v2.5 Live
</span>
</a>
{/* Desktop Navigation Links */}
<div className="hidden md:flex items-center gap-6 text-xs font-semibold text-slate-400">
<div key="Products" className="relative group">
<a href="#"
onMouseEnter={() => setMegaMenuOpen(true)} onClick={(e) => { e.preventDefault(); setMegaMenuOpen(!megaMenuOpen); }}
className="flex items-center gap-1 hover:text-white transition-colors py-2 text-white font-bold"
>
<span>Products</span>
<svg className="w-3.5 h-3.5 opacity-60 group-hover:rotate-180 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 9l-7 7-7-7" /></svg>
</a>
{/* Desktop Mega-Menu Dropdown Panel */}
{megaMenuOpen && (
<div
onMouseLeave={() => setMegaMenuOpen(false)}
className="absolute left-0 top-full mt-2 w-[540px] rounded-2xl border border-slate-800 bg-slate-950/95 backdrop-blur-2xl p-6 shadow-2xl z-50 grid grid-cols-2 gap-6 text-left"
>
<div className="space-y-4">
<span className="text-[11px] font-bold text-slate-400 uppercase tracking-wider">Core Platforms</span>
<div className="space-y-3">
<a href="#" className="block p-2.5 rounded-xl hover:bg-slate-900 transition-colors">
<div className="font-bold text-sm text-white">Cloud Engine</div>
<div className="text-xs text-slate-400">Edge-accelerated serverless runtimes</div>
</a>
<a href="#" className="block p-2.5 rounded-xl hover:bg-slate-900 transition-colors">
<div className="font-bold text-sm text-white">AI Studio</div>
<div className="text-xs text-slate-400">Autonomous agentic generation workflows</div>
</a>
</div>
</div>
<div className="p-4 rounded-xl border border-slate-800 bg-slate-900/60 flex flex-col justify-between">
<div>
<span className="px-2 py-0.5 rounded-full bg-emerald-500/20 text-emerald-400 text-[10px] font-bold uppercase">New Release</span>
<h4 className="font-bold text-sm mt-2 text-white">What's New in v2.5</h4>
<p className="text-xs text-slate-400 mt-1 leading-relaxed">Faster build outputs, enhanced security audits & zero cold starts.</p>
</div>
<a href="#" className="text-xs font-bold text-indigo-400 hover:text-indigo-300 mt-4 inline-flex items-center gap-1">
Explore Documentation β
</a>
</div>
</div>
)}
</div>
<div key="Solutions" className="relative group">
<a href="#"
className="flex items-center gap-1 hover:text-white transition-colors py-2"
>
<span>Solutions</span>
<svg className="w-3.5 h-3.5 opacity-60 group-hover:rotate-180 transition-transform" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M19 9l-7 7-7-7" /></svg>
</a>
</div>
<div key="Pricing" className="relative group">
<a href="#"
className="flex items-center gap-1 hover:text-white transition-colors py-2"
>
<span>Pricing</span>
</a>
</div>
<div key="Docs" className="relative group">
<a href="#"
className="flex items-center gap-1 hover:text-white transition-colors py-2"
>
<span>Docs</span>
</a>
</div>
<div key="Changelog" className="relative group">
<a href="#"
className="flex items-center gap-1 hover:text-white transition-colors py-2"
>
<span>Changelog</span>
</a>
</div>
</div>
</div>
{/* Right Desktop Utilities & Actions */}
<div className="hidden sm:flex items-center gap-3">
{/* Command Palette Trigger */}
<button
type="button"
onClick={() => setCommandPaletteOpen(true)}
className="flex items-center gap-2 pl-3 pr-2.5 py-1.5 rounded-lg border border-slate-800 bg-slate-900 text-slate-400 hover:text-white text-xs transition-colors"
>
<svg className="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" /></svg>
<span>Search...</span>
<kbd className="px-1.5 py-0.5 rounded-md bg-slate-800 text-slate-300 text-[10px] font-mono">βK</kbd>
</button>
{/* Internationalization / Language Switcher */}
<div className="relative">
<button
type="button"
onClick={() => setLanguageOpen(!languageOpen)}
className="p-1.5 sm:p-2 rounded-lg border border-slate-800 hover:bg-slate-900 text-white text-xs font-semibold flex items-center gap-1"
aria-label="Language Selector"
>
<span>π</span>
<span>{selectedLang}</span>
</button>
{languageOpen && (
<div className="absolute right-0 top-full mt-2 w-36 rounded-xl border border-slate-800 bg-slate-950 text-white p-1.5 shadow-xl z-50 text-xs">
{['EN - English', 'ES - EspaΓ±ol', 'DE - Deutsch', 'FR - FranΓ§ais', 'JA - ζ₯ζ¬θͺ'].map(l => (
<button
key={l}
onClick={() => { setSelectedLang(l.slice(0, 2)); setLanguageOpen(false); }}
className="w-full text-left px-2 py-1.5 rounded-lg hover:bg-slate-900 transition-colors"
>
{l}
</button>
))}
</div>
)}
</div>
{/* Notifications Bell with Unread Badge */}
<div className="relative">
<button
type="button"
onClick={() => setNotificationsOpen(!notificationsOpen)}
className="p-2 rounded-lg border border-slate-800 relative transition-colors hover:bg-slate-900 text-slate-400 hover:text-white"
aria-label="View notifications"
>
<svg className="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9" /></svg>
<span className="absolute top-1 right-1 w-2 h-2 rounded-full bg-rose-500 animate-pulse" />
</button>
{notificationsOpen && (
<div className="absolute right-0 top-full mt-2 w-72 rounded-2xl border border-slate-800 bg-slate-950 text-slate-100 p-3 shadow-2xl z-50 space-y-2">
<div className="text-xs font-bold border-b border-slate-800 pb-2 flex justify-between items-center">
<span>Notifications</span>
<span className="text-[10px] text-emerald-400 font-semibold cursor-pointer">Mark all read</span>
</div>
<div className="space-y-1 text-xs">
<div className="p-2 rounded-lg bg-slate-900/60">
<div className="font-semibold">π Deployment Success</div>
<div className="text-[10px] text-slate-400">Live on 14 edge regions</div>
</div>
</div>
</div>
)}
</div>
<a href="#" className="text-xs font-semibold text-slate-400 hover:text-white transition-colors">
Sign In
</a>
<a href="#"
className="px-4 py-2 rounded-full text-xs font-bold bg-indigo-600 hover:bg-indigo-500 text-white shadow-lg shadow-indigo-600/25 transition-transform hover:scale-105 shadow-xs"
>
Get Started Free
</a>
{/* User Profile Avatar with Menu */}
<div className="relative">
<button
type="button"
onClick={() => setProfileMenuOpen(!profileMenuOpen)}
className="w-8 h-8 rounded-full bg-gradient-to-tr from-indigo-500 to-purple-600 flex items-center justify-center text-xs font-bold text-white relative shadow-xs cursor-pointer"
aria-label="User account"
>
U
<span className="absolute bottom-0 right-0 w-2.5 h-2.5 rounded-full bg-emerald-500 border-2 border-slate-950" />
</button>
{profileMenuOpen && (
<div className="absolute right-0 top-full mt-2 w-56 rounded-2xl border border-slate-800 bg-slate-950 text-white p-2 shadow-2xl z-50 text-xs">
<div className="p-2 border-b border-slate-800 mb-1">
<div className="font-bold">user@mobiflix.dev</div>
<div className="text-[10px] text-emerald-400">Pro Organization</div>
</div>
<a href="#" className="block px-2 py-1.5 rounded-lg hover:bg-slate-900">Settings & API Keys</a>
<a href="#" className="block px-2 py-1.5 rounded-lg hover:bg-slate-900">Billing & Invoices</a>
<a href="#" className="block px-2 py-1.5 rounded-lg text-rose-400 hover:bg-slate-900">Sign Out</a>
</div>
)}
</div>
</div>
{/* Mobile Hamburger Menu Button */}
<div className="flex md:hidden items-center gap-2">
<button
type="button"
onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
className="p-2 rounded-xl border border-slate-800 text-slate-400 hover:text-white focus:outline-hidden"
aria-label="Toggle navigation menu"
>
<svg className="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
{mobileMenuOpen ? (
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M6 18L18 6M6 6l12 12" />
) : (
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M4 6h16M4 12h16M4 18h16" />
)}
</svg>
</button>
</div>
</div>
</nav>
{/* Mobile Navigation Renderers */}
{/* Mobile Off-Canvas Slide Drawer */}
{mobileMenuOpen && (
<div className="fixed inset-0 z-50 md:hidden flex justify-end">
<div onClick={() => setMobileMenuOpen(false)} className="fixed inset-0 bg-slate-950/70 backdrop-blur-xs transition-opacity" />
<div className="relative w-full max-w-xs bg-slate-950 text-white h-full shadow-2xl p-6 flex flex-col justify-between overflow-y-auto border-l border-slate-800 z-50">
<div className="space-y-6">
<div className="flex items-center justify-between pb-4 border-b border-slate-800">
<span className="font-extrabold text-base">Mobiflix</span>
<button onClick={() => setMobileMenuOpen(false)} className="p-1.5 rounded-lg border border-slate-800 text-slate-400">β</button>
</div>
<nav className="flex flex-col space-y-1">
<a href="#" key="Products" className="flex items-center justify-between px-3 py-2.5 rounded-xl text-xs font-semibold hover:bg-slate-900 text-white transition-colors">
<span>Products</span>
<span className="text-slate-400">β</span>
</a>
<a href="#" key="Solutions" className="flex items-center justify-between px-3 py-2.5 rounded-xl text-xs font-semibold hover:bg-slate-900 text-white transition-colors">
<span>Solutions</span>
<span className="text-slate-400">β</span>
</a>
<a href="#" key="Pricing" className="flex items-center justify-between px-3 py-2.5 rounded-xl text-xs font-semibold hover:bg-slate-900 text-white transition-colors">
<span>Pricing</span>
<span className="text-slate-400">β</span>
</a>
<a href="#" key="Docs" className="flex items-center justify-between px-3 py-2.5 rounded-xl text-xs font-semibold hover:bg-slate-900 text-white transition-colors">
<span>Docs</span>
<span className="text-slate-400">β</span>
</a>
<a href="#" key="Changelog" className="flex items-center justify-between px-3 py-2.5 rounded-xl text-xs font-semibold hover:bg-slate-900 text-white transition-colors">
<span>Changelog</span>
<span className="text-slate-400">β</span>
</a>
</nav>
</div>
<div className="pt-6 border-t border-slate-800 space-y-3">
<a href="#" className="block w-full py-2.5 text-center text-xs font-semibold border border-slate-800 rounded-xl">Sign In</a>
<a href="#" className="block w-full py-2.5 text-center text-xs font-bold rounded-xl bg-indigo-600 hover:bg-indigo-500 text-white shadow-lg shadow-indigo-600/25">Get Started Free</a>
</div>
</div>
</div>
)}
</header>
{/* Interactive βK Command Palette Modal */}
{commandPaletteOpen && (
<div className="fixed inset-0 z-50 flex items-start justify-center pt-20 p-4">
<div onClick={() => setCommandPaletteOpen(false)} className="fixed inset-0 bg-slate-950/80 backdrop-blur-xs" />
<div className="relative w-full max-w-lg rounded-2xl border border-slate-800 bg-slate-950 text-white shadow-2xl p-4 space-y-4 z-50">
<div className="flex items-center gap-2 border-b border-slate-800 pb-3">
<svg className="w-4 h-4 text-indigo-500" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" /></svg>
<input type="text" placeholder="Type a command or search documentation..." className="w-full bg-transparent text-sm outline-hidden font-medium" autoFocus />
<button onClick={() => setCommandPaletteOpen(false)} className="text-xs text-slate-400 hover:text-white">ESC</button>
</div>
<div className="space-y-1 text-xs">
<div className="text-[10px] font-bold text-slate-400 uppercase tracking-wider px-2">Navigation</div>
<a href="#" className="flex items-center justify-between px-3 py-2 rounded-xl hover:bg-slate-900 transition-colors"><span>Go to Products</span><span className="text-[10px] text-slate-400 font-mono">Jump β΅</span></a>
<a href="#" className="flex items-center justify-between px-3 py-2 rounded-xl hover:bg-slate-900 transition-colors"><span>Go to Solutions</span><span className="text-[10px] text-slate-400 font-mono">Jump β΅</span></a>
<a href="#" className="flex items-center justify-between px-3 py-2 rounded-xl hover:bg-slate-900 transition-colors"><span>Go to Pricing</span><span className="text-[10px] text-slate-400 font-mono">Jump β΅</span></a>
<a href="#" className="flex items-center justify-between px-3 py-2 rounded-xl hover:bg-slate-900 transition-colors"><span>Go to Docs</span><span className="text-[10px] text-slate-400 font-mono">Jump β΅</span></a>
<a href="#" className="flex items-center justify-between px-3 py-2 rounded-xl hover:bg-slate-900 transition-colors"><span>Go to Changelog</span><span className="text-[10px] text-slate-400 font-mono">Jump β΅</span></a>
</div>
</div>
</div>
)}
</div>
);
}How to Use Navbar Generator
Select a layout archetype: Modern Floating Pill, SaaS Enterprise Mega-Menu, Developer Terminal / Command Bar, E-Commerce Hub, or Clean Editorial.
Customize brand logo name, navigation links, announcement ticker bar, search trigger, and action buttons.
Configure advanced features: Interactive Mega-Menus, Notification Popovers, User Profile, and Announcement Banners.
Choose mobile menu animation style: Slide-out Off-Canvas Drawer, Floating Card Dropdown, Full-Screen Overlay, or Mobile App Dock Bar.
Test responsiveness interactively in Desktop, Tablet, and Mobile viewports with live drawer expansion.
Copy 100% production-ready Tailwind CSS code in React (JSX) or standard HTML5 format.
Frequently Asked Questions
Does the generated navbar include mobile responsive menu code?
Yes, complete mobile responsive code is included supporting slide-out side drawers, floating card dropdowns, full-screen sheets, or mobile app bottom bars with clean Tailwind classes.
How does the Mega-Menu feature work?
The Mega-Menu option creates multi-column dropdown panels containing product links, feature descriptions, icon grids, and featured promotional highlight cards.
Can I use this navbar directly in Next.js or React?
Yes! Toggle the 'React (JSX)' tab to copy full functional component code with React useState hooks for mobile toggles, mega-menus, and notifications, or select 'HTML5' for static web projects.
Does it support backdrop blur glassmorphism and sticky headers?
Yes, you can toggle sticky positioning (sticky top-0 z-50) and optical backdrop blur (backdrop-blur-md) with custom transparency levels.
Related Developer Tools
Explore more free client-side developer utilities in this category
Color Picker
Interactive color picker with HEX, RGB, HSL, and CMYK color code converters.
HEX to RGB Converter
Convert 3-digit and 6-digit HEX color codes into standard rgb() and rgba() formats.
RGB to HEX Converter
Convert red, green, and blue values (0-255) into standard CSS hexadecimal codes.
Gradient Generator
Generate beautiful CSS linear and radial gradients with custom color stops and angle controls.
Glassmorphism Design Generator
Advanced Frosted Glassmorphism Studio: optical backdrop-blur, saturation boost, multi-tinted frosted glass, specular border reflections, floating background scenes, with standard CSS and Tailwind classes.
Neumorphism Design Generator
Advanced Soft UI generator: dynamic 4-way light angles, concave/convex gradients, pressed states, with CSS & Tailwind classes.