js-offcanvas v2: a vanilla JavaScript library for accessible offcanvas navigation panels.
Key features:
- Four positions: left, right, top, bottom
- ARIA roles, aria-expanded, and aria-modal managed automatically
- Tab focus trapping and Escape key support
- Background inert attribute for screen reader safety
- Data attribute auto-init, no JavaScript required for basic use
- ES module, zero runtime dependencies
👉 Blog Post
👉 GitHub Repo
👉 Live Demo
Top comments (0)