Drawer

Promise-based side panel system. Works identically to Modal — open() returns a Promise that resolves when the drawer calls close(value). Drawers slide in from any screen edge. Left/right drawers use widths; top/bottom drawers use heights.

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

Pass a Svelte component to drawerManager.open(). The component receives any props you provide, plus access to getDrawerManager() to close itself.


Position & Size

Use the options parameter to set an edge, named size or class override. Left/right widths are small=320px, compact=384px, normal=512px; top/bottom heights are small=192px, compact=256px, normal=384px.


Application setup

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