
CSS Glassmorphism Frosted Navbar
Published
A responsive CSS navbar is the chrome at the top of every page — the single most-used component on the web. These 20 hand-coded designs cover the full modern navbar playbook — glassmorphism, mega menu dropdown, sidebar drawer, animated underline tabs, pill highlight, scroll-shrink, neon, reading-progress, bottom tab bar, gradient border, centered logo, fullscreen overlay, morphing search, floating island, scroll-spy and more. Every demo uses scoped .nav-NN class names that never collide with your existing styles, honours prefers-reduced-motion, and ships under the MIT license.
Related15 CSS Navigation Menu Designs28 CSS Hamburger Menus16 CSS Mobile Navigation Patterns

Published

Published

Published

Published

Published

Published

Published

Published

Published

Published

Published

Published
Published

Published

Published

Published

Published

Published

Published

Published
.nav-NN so you can copy multiple patterns into the same page without style collisions while you decide.height on the layout (e.g. height: 80px) and shrink only the internal elements (logo size, padding, font-size) via a .is-shrunk class. Demo #06 (Scroll-Aware Shrink Navbar) ships this pattern: the outer nav stays at fixed height: 80px sticky-positioned, an IntersectionObserver toggles .is-shrunk on scroll, and the children animate their own dimensions inside the constant outer box. Modern alternative (Chrome 115+, Safari 26+): use scroll-driven animations with animation-timeline: scroll(root) instead of an IntersectionObserver — zero JavaScript, GPU-accelerated, no main-thread scroll listener. The CSS export in Demo #06 includes both implementations so you can pick based on browser support targets.:hover on desktop and :focus-within for keyboard), hamburger toggles (checkbox-hack with hidden input + sibling selectors), animated underlines (:hover + ::after pseudo), pill highlights (:has() in modern browsers or radio-button state machines), and most static layout patterns. JavaScript is required for: scroll-spy active highlighting (you need IntersectionObserver or scroll-driven animations with the new animation-timeline: scroll()), reading-progress bars that track exact scroll percentage, focus traps inside fullscreen overlay menus (WCAG 2.4.3 requires it for modal-like UI), Escape-key dismissal, and persistent state across page navigations. We ship 14 pure-CSS demos and 6 with a vanilla-JS snippet (no framework, no library, no jQuery) for the patterns that genuinely require it. Each JS snippet is 5–30 lines and lives in the demo's JS tab — copy alongside the CSS tab and drop into a <script> at the bottom of your page.:hover opens / :hover closes. That breaks keyboard users (Tab can't enter the panel because hover is mouse-only) and screen-reader users (the open/closed state isn't announced). The WCAG 2.2 / Section 508 / EU EAA accessible pattern requires: (1) :focus-within opens the panel on keyboard focus (works alongside :hover), (2) aria-expanded="true|false" on the parent trigger announces the state, (3) aria-haspopup="menu" tells screen readers there's a submenu, (4) Escape key closes the panel and returns focus to the trigger, (5) arrow-key navigation within the panel (Roving tabindex pattern), (6) the panel itself uses role="menu" with children as role="menuitem". Demo #02 (CSS Mega Menu Dropdown Navbar) ships the full pattern, and Demo #14 (Full-Screen Overlay Menu) implements a complete focus trap with focus return on close. Tools to audit: axe DevTools, Lighthouse, WAVE, NVDA + screen reader testing — every one of these will catch the missing aria-expanded that 90% of tutorial mega menus ship without.NavigationMenu + DropdownMenu primitives. Material UI / MUI: ships <AppBar> with Material aesthetics and ~95kb bundle cost. Chakra UI: composable but you assemble nav from Flex + Menu primitives. Ant Design: ships <Menu mode='horizontal'> with enterprise-friendly defaults. Bootstrap 5: ships .navbar + .navbar-collapse with the canonical mobile collapse pattern. This generator vs. all of the above: these are EDITABLE source CSS / HTML / JS — copy what you like and customize freely (brand color, exact corner radius, specific hover behaviour). Use the component libraries when you want a complete design system in 30 seconds. Use these demos when you want fine control or when you're building your own design system from scratch and need the source CSS to inform your token decisions. Drop any demo's CSS into our converter to see the Tailwind utility-class equivalent.IntersectionObserver to watch each section enter/leave the viewport and toggle .is-active on the matching nav link. Demo #20 (CSS Scroll Spy Active Highlight Navbar) ships this pattern in ~15 lines of vanilla JS: const obs = new IntersectionObserver(entries => entries.forEach(e => { if (e.isIntersecting) document.querySelector(a[href="#${e.target.id}"]).classList.add('is-active'); }), { threshold: 0.5 }); then iterate all section[id] elements and observe them. The IntersectionObserver is GPU-friendly and doesn't run on every scroll frame like a manual window.scroll listener would. Modern alternative (Chrome 115+ / Edge 115+ / Opera 101+; partial Safari 26+ / Firefox 134+): CSS scroll-driven animations via animation-timeline: view() let you do scroll-spy entirely in CSS — animate --active custom property as each section scrolls through the viewport, then use :has() + @scope to flip the matching nav link's color. Zero JavaScript. Demo #20's CSS includes a commented-out scroll-driven-animations version next to the IO implementation.@media queries.font-display: optional or font-display: swap + size-adjust in @font-face. (2) Shrink-on-scroll without fixed height: the navbar's height changes on scroll → entire page-below-navbar shifts up. Fix described in FAQ #2 — keep outer navbar height constant, shrink only inner elements. (3) Logo image with no dimensions: image loads asynchronously and reflows the layout. Fix: width + height attributes on <img>, or aspect-ratio: 4/1 on the logo container. (4) Mobile hamburger toggle uses display: none → block: the menu's opening shifts content. Fix: use transform: translateY() + height: 100dvh on an overlay (no layout impact). (5) Sticky positioning glitch: position: sticky on a navbar inside an overflow: hidden parent silently fails on some browsers. Fix: move sticky to a direct child of <body> and ensure no ancestor clips overflow. Tools to verify: Chrome DevTools Performance Insights, Lighthouse, Core Web Vitals report in Google Search Console, axe DevTools, WebPageTest filmstrip.max-width: 720px via media query, hidden at desktop where a conventional top navbar takes over. Add padding-bottom: 72px to main on mobile so the fixed bottom bar doesn't overlap content. Use 3–5 tabs maximum (more than 5 reduces tap accuracy). Each tab needs a 24×24px icon minimum + label below ≤ 12px. Mark the active tab with both color AND a small indicator (icon dot, top border, or fill) — color alone fails WCAG 1.4.1 (Use of Color).<nav> + <ul>/<li> structure, aria-current="page" on the active link, aria-label on icon-only buttons, visible :focus-visible rings, aria-expanded on toggles, focus trap on modal-like overlays, Escape-key dismissal, and proper landmark roles so screen-reader users navigate them correctly. Continuous animations honour prefers-reduced-motion: reduce. The collection ships ready to pass WCAG 2.2 AA — verify with axe DevTools, Lighthouse, or WAVE before shipping to EU EAA / US Section 508 / UK Equality Act audits.32 free CSS accordions covering pure-CSS FAQ blocks with details/summary, mobile navigation menus, e-commerce filter sidebars, nested tree views, exclusive single-open groups and smoothly animated height:auto — plus 26 visual variations in vertical, horizontal and hybrid layouts. Copy-paste HTML and CSS, no JavaScript.
39 hand-coded CSS breadcrumbs — Schema.org BreadcrumbList Microdata + WCAG 2.2 accessible (Google Rich Results eligible), :has() responsive collapse, dark/light theme toggle with color-mix, Shopify/Amazon e-commerce filter chip removal, Vercel/Linear/Notion SaaS dashboard app-shell pattern, Docusaurus/Mintlify sticky scroll-shrink header, Amazon-style dropdown sibling menus, NFT/Web3 holographic shimmer (@property + conic-gradient), SaaS marketing gradient text, Airbnb filter chip with container queries, editorial blog wave underline, developer docs one-click path copy (Clipboard API), and 26 more. Semantic HTML: <nav aria-label='Breadcrumb'> + <ol> + aria-current='page'. Framework-agnostic, MIT-licensed.
26 hand-coded CSS circular and radial menu designs, from the floating-action FAB speed dial and dashboard radial hubs to game-style pie-slice wheels, SVG gooey metaball fans, hexagonal honeycombs, iris-aperture reveals, orbiting satellites on offset-path, compass-rose directional nav, sci-fi HUD rings, glassmorphism popovers built on the native Popover API, vinyl-record players, and full-takeover nebula overlays on native dialog. Every design uses CSS trigonometry (sin(), cos()) or the counter-rotation trick for positioning, ships real keyboard navigation, aria-labels on icon-only buttons, and a prefers-reduced-motion guard. Copy-paste HTML, CSS and vanilla JS with zero framework dependencies — MIT licensed.