Features/Interactions

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.

  1. Add a click interaction on the opener: State set, Scroll Lock lock, Focus trap.
  2. 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.

No card needed

Build it today.Pay when it goes live.

Every feature is unmetered while you build. Checkout opens the first time you publish.