The public ModalContainer, DrawerContainer, PopupContainer and ToastContainer render manager state. They are not triggers. Import them from @atom-forge/ui only when implementing manual setup or a supported nested popup.
Version 0.0.34 exports Root, not AtomForge (the provider name still used in some packaged guides). Place Root once in the application layout. It creates all four managers, a theme manager and the portal target, and mounts the renderers. Do not add extra containers under it. Context getters belong in descendant component initialization.
This alternative deliberately omits Root and its theme/body styling. It registers all overlay managers and renders the shared stack exactly once. ModalContainer and DrawerContainer are equivalent wrappers around the same internal renderer: using both duplicates every modal and drawer. Supply your own theme setup and load the library stylesheet in the application.
Modal and Drawer share opening order and a single visible backdrop. A manager’s close/resolve targets the last overlay of that kind, which need not be the topmost overall. User dismissal only closes the topmost closable overlay. Keys deduplicate within the overlay kind; duplicate opens resolve immediately with undefined.
Root’s navigation hook clears every modal/drawer and resolves their promises with undefined, even when closable=false. It also resolves the root popup immediately. Toasts survive navigation and retain their timers. Manual setups need equivalent cleanup, as shown above.
Popup and Toast use separate fixed tiers above the shared stack. Zen is a separate declarative overlay, not a managed stack entry. To customize the shared backdrop, override the library’s overlay-backdrop CSS class in a stylesheet loaded after the library.
See Modal, Drawer, Popup and Toast for opening content, results and nested popups.