Open experiment
Floating navigation
A restrained navigation bar that floats above page content, collapses cleanly on small screens, and keeps its menu behavior keyboard accessible.
Lab tested Responsive Dark mode Interactive
- Version
- 1.0.0
- Updated
- 2026-08-02
- Dependencies
- Zero
<nav class="cmp-floating-nav" aria-label="Primary navigation">
<a class="cmp-floating-nav__brand" href="#">Northstar</a>
<button
class="cmp-floating-nav__toggle"
type="button"
aria-expanded="false"
aria-controls="cmp-floating-nav-menu"
>
<span class="cmp-floating-nav__toggle-label">Menu</span>
<span aria-hidden="true">+</span>
</button>
<div class="cmp-floating-nav__menu" id="cmp-floating-nav-menu">
<a href="#features">Features</a><a href="#work">Work</a><a href="#pricing">Pricing</a>
<a class="cmp-floating-nav__cta" href="#start">Start a project</a>
</div>
</nav>
No runtime reactions detected Open in Editor
Validated in the lab
Experiment report
- Schema and source files passed
- Responsive test passed
- Keyboard test passed
- No console errors
Component ingredients
- Dependencies
- None
- Browser support
- Current Chrome, Current Edge, Current Firefox, Current Safari
- Version
- 1.0.0
- Last tested
- 2026-08-02
Accessibility notes
- Menu trigger exposes expanded state.
- Escape closes the mobile menu and restores focus.
- Links include visible focus styles.
License: MIT License for open-source use, modification, and distribution.