Accessible Navigation Menu
Creates a semantic navigation menu with proper ARIA attributes, keyboard navigation, current page indication, and responsive hamburger toggle.
Code
<nav aria-label="Primary navigation">
<button class="menu-toggle"
aria-expanded="false"
aria-controls="main-menu"
aria-label="Toggle navigation menu">
<span class="hamburger"></span>
</button>
<ul id="main-menu" class="menu" role="menubar">
<li role="none">
<a href="/" role="menuitem" aria-current="page">Home</a>
</li>
<li role="none">
<a href="/products" role="menuitem">Products</a>
</li>
<li role="none">
<a href="/about" role="menuitem">About</a>
</li>
<li role="none">
<a href="/blog" role="menuitem">Blog</a>
</li>
<li role="none">
<a href="/contact" role="menuitem">Contact</a>
</li>
</ul>
</nav>
<nav aria-label="Breadcrumb">
<ol class="breadcrumb">
<li><a href="/">Home</a></li>
<li><a href="/products">Products</a></li>
<li aria-current="page">Details</li>
</ol>
</nav>
<style>
.menu { list-style: none; display: flex; gap: 1rem; }
.menu a { text-decoration: none; padding: 0.5rem 1rem; }
.menu a[aria-current="page"] { font-weight: bold; border-bottom: 2px solid currentColor; }
.breadcrumb { list-style: none; display: flex; gap: 0.5rem; }
.breadcrumb li:not(:last-child)::after { content: " > "; }
</style>Navigation menus use <nav> with aria-label for context. role="menubar"/role="menuitem" enable ARIA menu semantics. aria-current="page" indicates the current page. aria-expanded/aria-controls on the toggle button manage the responsive state. Breadcrumbs use an ordered list (<ol>) to show hierarchy. Always provide skip-to-content links for keyboard users.
Interactive Tools for This Topic
JSON to Zod Schema ConverterInfer typed Zod z.object schemas from JSON payloads locally, supporting nested objects, merged array shapes, enums, nullable fields, and JSDoc comments.JSON Schema ValidatorValidate JSON data against a JSON Schema definition and get detailed error reports. Supports type checking, required fields, and common constraint validation.JSONL / NDJSON InspectorValidate NDJSON and JSON Lines line-by-line, pinpoint syntax errors by line number, analyze key frequencies and types, and export a pretty JSON array.Credit Card Brand DetectorIdentify the card network from a number's prefix and length, validate the Luhn checksum, and show a masked form and the issuer identification number.
Report a problem with this exampleOpens a pre-filled issue on GitHub.