Modal

Promise-based modal system. open() and openSnippet() return a Promise that resolves when the modal calls resolve(value) — enabling clean async confirmation flows. Modals stack; closing one reveals the one below it.

Use Root once in the application layout: it sets up all managers, the portal target and the shared modal/drawer renderer. Do not add ModalContainer or DrawerContainer under Root, or render both containers together: each renders the same shared stack. Programmatic close/resolve closes the last overlay of that kind even when closable is false; backdrop/Escape only dismiss the overall topmost closable overlay.


Basic Usage

Use openSnippet() to define the modal inline. await the result to react to the user's choice.


Nested Modals

Modals can open further modals. Each has its own promise; the stack is managed automatically.


Application setup

Place Root in the application layout, not inside each example. Context getters must run during component initialization under this provider.