Business Popups Are Route Navigation, Not Child Components
Mid-to-backend systems and AI-driven interfaces both generate popups that must be invoked dynamically from arbitrary call sites and reused across different containers. Treating popup invocation as route navigation rather than child-component rendering eliminates the boilerplate and coupling that make these systems brittle, while the container-content split lets teams swap Dialog for Drawer or embed the same form inline without touching business logic.
The standard Vue pattern of welding a Dialog to its form with v-model breaks down as pages multiply: boilerplate balloons, invocation points scatter across deep component trees, and the same form can't be reused in a different container. vue-layerx treats popup invocation like router.push() — imperative scheduling — while content components remain pure, props-in/emits-out Vue components that know nothing about how they're hosted. A three-step API (createLayer pins the container, useDialog binds content, open() invokes) enforces a strict separation that makes swapping containers and reusing content independent operations.
The library pays explicit orchestration and runtime taxes: a four-level config merge chain (call-site > instance > content defaults > container defaults), a defineLayer macro that lets content declare its own container props, a LayerTemplate component that delivers SFC template slots across the container boundary without forcing JSX, and a closeOn contract that keeps close() out of content components entirely. Runtime concerns — context drift when DOM trees mount outside the main app, DevTools invisibility — are handled by a LayerHost that bridges appContext and an independent createApp that keeps layer trees debuggable.
Legacy monoliths where Dialog and form are still glued together can onboard gradually by treating the whole file as content with a no-container flag, preserving the target architecture while deferring the split. The design wasn't chosen for elegance; it's the narrow corridor that remains when all constraints — imperative scheduling, content purity, multi-role config merging, template-slot delivery, and runtime context integrity — are enforced simultaneously.
The root problem isn't too much declarative boilerplate — it's that the industry has miscategorized popup invocation as child-component rendering rather than navigation scheduling.
AI interaction pages make imperative popup scheduling non-negotiable because which popup opens and when is determined at runtime by model intent, not hardcoded at page init.
Most popup libraries fail on one specific link in the chain: either they force JSX for slot delivery, inject close() into content and destroy reusability, or ignore context drift and DevTools collapse.
The design wasn't chosen for elegance; it's the narrow corridor that remains when all constraints are enforced simultaneously — a shape pushed out by boundary problems, not drawn up front.