Responsive Off-Canvas Menu Example

Open index.htm in a browser to preview the menu. The example is standalone and has no external dependencies.

The mobile menu button reports its expanded state, moves focus into the menu when opened, and closes with Escape. Dropdown buttons work with keyboard, touch, and mouse. Escape closes an open dropdown first; a second press closes the mobile menu and restores focus to its button.

Replace the sample labels and #demo-content links, then adapt colors, spacing, and the mobile breakpoint to your project. Test keyboard and touch interaction after adapting it.