
CSS Hamburger Menu with Clip-Path Circle Expansion
Published
28 hand-coded CSS hamburger menus for SaaS headers, e-commerce mobile drawers, healthcare portals, and content-site nav: pure-CSS checkbox-hack, clip-path circle expansions, off-canvas drawers with backdrops, glassmorphism blur, Tailwind + Bootstrap 5 wiring, WCAG 2.2 AA patterns with aria-expanded + focus trap, <details><summary> nested accordions, bottom nav with FAB, plus neumorphic + brutalist + 3D perspective variants. Every menu is engineered for INP under 100ms with zero CLS. Scoped under .chm-NN for no-collision pasting, prefers-reduced-motion guarded, framework-agnostic.
Related16 CSS Mobile Navigation Patterns25 CSS Sticky Navigation17 CSS Side Menu Designs20 CSS Responsive Navbar Designs

Published

Published
Published

Published

<label>, and the :checked ~ sibling combinator drives the panel — no JavaScript anywhere in the chain. This version fixes the two mistakes in 90% of checkbox-hack tutorials: the input stays keyboard-reachable (clip, not display:none), and its focus ring is re-projected onto the visible burger.Published

Published

Published

Published

PublishedUpdated
PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated

PublishedUpdated
PublishedUpdated

PublishedUpdated

PublishedUpdated

<details>/<summary> — free keyboard support, free screen-reader disclosure announcements, free state. The 2024-25 platform upgrades do the rest: the name attribute makes top-level sections exclusive (opening Shop closes Support, accordion behavior that used to be a JS staple), and ::details-content + interpolate-size animate the expansion in supporting engines while everything else gets an honest instant toggle.PublishedUpdated
PublishedUpdated

PublishedUpdated
PublishedUpdated

PublishedUpdated

PublishedUpdated

Published
<input type="checkbox"> as the state machine — a <label> covers your hamburger button and points to the checkbox via for="toggle-id", clicking flips :checked, and CSS sibling selectors (~, +) project that state down into the panel + icon + backdrop. Works in every evergreen browser since 2010, keyboard-accessible for free (label is focusable, Space/Enter toggles the checkbox). The <details><summary> pattern (Demo 18 + Demo 22) is the semantic winner for multi-level accordion navigation — browsers ship free aria-expanded, free keyboard support (Enter/Space toggles), and the 2024 interpolate-size: allow-keywords CSS opt-in finally makes auto-height animation trivial (previously you needed the grid-template-rows: 0fr → 1fr workaround). The Popover API (Baseline 2024 — Chrome 114+, Safari 17+, Firefox 125+) is the newest option — a real button + popovertarget attribute + top-layer rendering (menu sits above every stacking context automatically) with light-dismiss (Escape or outside-click closes) built in. Decision matrix: single-level mobile drawer → checkbox-hack; multi-level nested nav → <details>; command-K-style overlay → Popover. All three ship in this collection with the correct WCAG 2.2 AA pattern including focus-visible outlines at 2px/3:1 contrast per SC 2.4.13.<span> bars inside the button, give each a transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .2s ease, then on the open state apply: top bar rotate(45deg) translateY(8px) to overlap the middle, bottom bar rotate(-45deg) translateY(-8px) to overlap the middle, middle bar opacity: 0 (or scaleX(0) if you want it to compress inward instead of fade). The Animated 3-Line to X demo (Demo 03) ships this exact recipe with the correct transform-origin: center anchor so the rotation happens around the visual center. Two common traps most tutorials miss: (1) transform-origin defaults to center 50% 50% which for a thin bar means it rotates around its own middle — if your bars have different widths (some designers taper them for aesthetic), the diagonal doesn't quite meet and looks broken; set transform-origin: center left or explicit center to fix. (2) The middle bar's opacity transition should be SHORTER than the rotation duration (200ms vs 300ms in Demo 03) so the middle disappears BEFORE the outer bars finish rotating — otherwise you see three lines briefly overlap in an X shape which reads as visual noise. Alternative morphs shipped in this collection: fold (top + bottom rotate inward toward center, middle stays static — Demo 02 variant), pinch (middle bar shrinks while top + bottom converge — Demo 02 variant), and the arrow-morph where bars morph into a left-pointing chevron (useful when the menu OPEN state is a full-screen takeover so the icon needs to signal 'go back' instead of 'close').false → true when open — screen readers announce state change per WCAG 4.1.2 Name Role Value. (3) aria-controls="menu-id" links the button to the panel it controls — SR users can jump directly to the referenced panel. (4) aria-label="Open menu" / "Close menu" on the icon-only button — WCAG 1.1.1 Non-text Content. (5) Visible :focus-visible ring at 2px minimum thickness with 3:1 contrast against the surface — WCAG 2.4.13 (October 2023 update). Use outline: 2px solid var(--acc); outline-offset: 2px, never outline: none without a replacement focus indicator. (6) Escape closes the menu and returns focus to the trigger — WCAG 2.1.2 (No Keyboard Trap inverse). Vanilla JS: panel.addEventListener('keydown', e => { if (e.key === 'Escape') { close(); trigger.focus(); } }). (7) Focus trap inside the open menu so Tab cycles through the menu's links instead of escaping to the page beneath — WCAG 2.4.3 Focus Order. Many 'accessible hamburger' listicles online stop at aria-expanded + aria-controls and miss the focus trap + return — both are required. This one pattern qualifies your site for Section 508 (36 CFR § 1194.22), EN 301 549 (EU public-sector procurement), ADA Title III (US private-sector), Canadian Accessible Canada Act 2019, Australian Disability Discrimination Act 1992 (upheld by Maguire v SOCOG 2000), and the UK Equality Act 2010. Enterprise buyers in regulated verticals (healthcare, fintech, legal, government) treat accessibility as a procurement checklist item — this pattern is the trust-signal moat.position: fixed; left: 0; top: 0; height: 100vh; width: 320px; transform: translateX(-100%) so it starts hidden off-canvas. On open, transform: translateX(0). Add a semi-transparent full-viewport backdrop with position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s that fades in — it provides visual depth AND doubles as a tap-target to close (clicking the backdrop closes the drawer, common user expectation). Prevent body scroll while the drawer is open (document.body.style.overflow = 'hidden' in the open handler) so users don't scroll the page beneath. Push-canvas (Demo 08): the sidebar sits at left: 0 from the start; the main content wrapper transforms translateX(320px) scale(0.95); border-radius: 24px to REVEAL the sidebar underneath (like YouTube's mobile app or Facebook Messenger). Add overflow: hidden on the shell so the pushed content doesn't create a horizontal scrollbar. For a WCAG-accessible drawer add the 7-point pattern from Q3 — the drawer is a <dialog> or a role='dialog' region with aria-modal='true' + focus trap + Escape close. On mobile Safari before 17.4 the <dialog> element wasn't well-supported — the checkbox-hack pattern (Demo 04) works cross-browser and back to iOS 12.cdn.tailwindcss.com) with a custom theme extension for the palette, then builds the trigger and the slide-in panel entirely from utility classes: flex items-center justify-center gap-1 for the bars wrapper, fixed inset-y-0 right-0 w-80 translate-x-full transition-transform duration-300 for the off-canvas panel, data-[state=open]:translate-x-0 for the open state (Tailwind v4 arbitrary-attribute variant), aria-expanded="true" and aria-controls="nav" hooks for accessibility. The morph is JS-driven (toggle data-state attribute) so Tailwind's static utilities can describe both states in one class list. Drop the snippet into any Tailwind v3.4+ or v4 project — no extension to your config needed beyond the palette. The Bootstrap 5 Responsive Navbar with Hamburger demo (Demo 08 + Demo 16) wires the native .navbar-toggler + data-bs-toggle="collapse" + data-bs-target="#nav" pattern (Bootstrap 5.3.3 syntax as of 2026) but reskins the default look completely — themed conic-gradient mark on the bars, morphing icon transition, glass collapse panel via backdrop-filter. Bootstrap's bundle.js handles the collapse mechanics natively; your CSS is just visual polish on top of .navbar-toggler[aria-expanded="true"] using Bootstrap's ARIA attribute as a hook. Drop into any Bootstrap 5 project — the markup is standard Bootstrap, just with extra theming classes. For projects using shadcn/ui or Radix instead, the same pattern maps to <Sheet> (shadcn) or <DropdownMenu> (Radix) primitives; both handle the WCAG accessibility contract for you but ship 15-40KB of runtime JavaScript vs the ~5-line vanilla version here.aria-modal='true' — enterprise buyers in this vertical run WCAG audits as part of procurement. Demo 22 (Multi-Level Accordion with <details>) is the correct pick for Airtable/Retool/Notion-style workspace navigation with 20+ nested resource types. E-commerce mobile ($3-25 CPM depending on tier): Demo 06 (Integrated Search + Social Drawer) is the Amazon/Shopify Dawn/Etsy pattern — search box takes primary real estate at the top of the drawer since 60%+ of mobile e-comm sessions start with search. Demo 21 (Mobile Bottom Nav Floating Hamburger) is the PWA app-shell pattern used by Instagram, Airbnb, Uber Eats — bottom nav for primary destinations + FAB hamburger for the overflow menu (WCAG 2.5.5 44px hit-target compliant). Healthcare / HIPAA-adjacent portals ($30-50 CPM): Demo 17 (WCAG Accessible) is the required pattern — Epic MyChart, Zocdoc, Teladoc all face HHS Section 508 refresh + ADA Title III statutory requirements. The 7-point WCAG contract from Q3 is non-negotiable for HIPAA-adjacent tools. Legal / financial-services SaaS ($30-60 CPM legal, $25-45 fintech): Demo 22 (Multi-Level Accordion) maps to Clio/MyCase/Rocket Matter legal case-management (firm → matter → task → document tree) and Bloomberg/Robinhood/Coinbase fintech dashboards (asset class → portfolio → position → trade tree). Restaurant / hospitality ($5-8 CPM): Demo 07 (Glassmorphism Backdrop Blur) fits the OpenTable/Resy/Yelp aesthetic — the blur reads as premium while keeping the menu readable over food photography. Real estate / property ($15-30 metro / $30-60 luxury CPM): Demo 04 (Off-Canvas with Dimmed Backdrop) is the Zillow/Redfin/Compass mobile pattern — the drawer holds filter + saved-search + agent-contact controls that need enough vertical space to breathe. Each of these VERY-HIGH-tier verticals rewards the accessibility + performance moat this collection ships.:has() + :checked + :target state — pure CSS, no event listener, no JavaScript on the interaction path. The 17 JS demos each ship a self-contained snippet under 30 lines with requestAnimationFrame where relevant + passive: true on any scroll listeners; INP is 8-24ms depending on the demo's animation complexity. CLS is 0 across all 28 because every menu open/close uses transform or opacity (GPU-composited, no layout thrash) instead of display: none → display: block (which triggers reflow) or height: 0 → auto (which triggers reflow). The one exception to watch: the 3D Rotating Canvas demo (Demo 28) uses filter: blur() on the backdrop which triggers a filter compositing layer + adds 4-12ms to INP on lower-end Android — we ship a @media (max-width: 480px) fallback that swaps filter: blur() for a plain background: rgba(0,0,0,0.5) on those viewports, keeping INP under 100ms on every device. Compared to shadcn's Sheet primitive (Radix Dialog + 40KB of runtime JS): this collection ships 0KB of runtime JS for the Pure CSS demos and ~1.5KB gzipped per JS demo, which is what turns a 'Poor CWV' page into a 'Good CWV' page on Google Ads Quality Score (a 20-40% lower cost-per-click for the same ad placement) and moves the page above competitors in the SERP ranking.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.