useOverlay

Focus, scroll and Escape for anything over the page: dialogs, sheets, lightboxes. Overlays form one app-wide stack, so only the top one traps Tab and hears Escape, page scroll is locked once for the stack, and closing a nested overlay hands focus back into the one beneath. AppModal and AppImageModal use it.

Install: pnpm add-composable useOverlay

Nested panels

Open the outer panel, then the inner one. Escape closes only the top panel; focus returns to the button that opened it; scroll stays locked until both are closed.

API