Accessible menus and modals
Focus trap, focus return, scroll lock, Escape and outside-press handling for menus and dialogs, without code.
Divhunt's interaction engine includes the pieces needed for accessible dialogs and menus: the Focus action moves and traps keyboard focus, Scroll Lock stops the page from scrolling, On Key listens for Escape or arrows, and On Outside Press closes things when you click away. Combined with named states and aria attributes (Attribute action), they build modals, mega menus and tabs that work with the keyboard.
How it works
- Focus action: move first/last/next/prev/trigger/self/none; trap yes/no/release; group selector for next/prev.
- Scroll Lock: lock/unlock with a key; the page stays locked while any key holds it; no layout jump.
- On Key: scope inside/anywhere, prevent default, key names (KeyboardEvent.key, comma separated).
- On Outside Press: ignore selector, when selector.
- Hover event option: keyboard focus inside counts as hover.
- MCP presets: accordion and tabs (exposed); modal, mega-menu, tabs-keyboard (not yet exposed).
When to use it
- A modal that traps focus and closes on Escape
- A mega menu that closes on outside click
Limitations
- Preset bundles are only available through MCP; in the editor you assemble the interactions yourself.
Availability
- Works in Designer and MCP.
- Included in every plan.
How to use it.
- Add a click interaction on the opener: State set, Scroll Lock lock, Focus trap.
- Add On Key (Escape) and On Outside Press interactions that clear the state, unlock scroll and release focus.
Questions.
Can I return focus to the button that opened a dialog?
Related features.
Named states
Set named states like menu-open or tab=2 that CSS, other interactions and conditions can read.
Interaction actions
Animate, toggle classes or attributes, show or hide, scroll, redirect, send HTTP requests, set cookies and more.
Interaction events
Start interactions on clicks, hover, keys, scroll, view, forms, page changes, states and member login events.
Browse other features
Designer
Bring your ideas to life with our visual website builder. Drag and drop with ease, or dive into coding when needed.
→AI Studio
Describe it and AI builds it. Every change lands in the same project you can open in the Designer.
→MCP
Connect Claude Code, Cursor or any MCP client and build whole sites with your own agent.
→CMS
Create, organize, and manage your dynamic content with the maximum freedom and flexibility of our visual CMS.
→SEO
Divhunt delivers ultra-fast & structured sites that are good for ranking by default, while offering complete control for customization.
→REST API
Easily link to any REST API endpoint with instant preview and expand your site’s functionality smoother than ever before.
→Plugins
Divhunt offers an open platform for creating plugins to upgrade features, add new capabilities, and simplify building better sites.
→Localization
Localize everything from static pages and CMS content to URLs and metadata, in up to 15 languages with no add-on.
→Interactions
Visually create animations and interactions with a simple, intuitive timeline. Build smooth, engaging experiences without code.
→Custom Files
Manage JS and CSS files with a structure developers love, combining folders and clean organization.
→Memberships
Create plans, decide who sees what and connect it all to your CMS. Build courses, communities or client portals.
→