Summary
Add a defaultTeleport option to createStackPlugin so all Portals inherit a teleport target app-wide, without per-component opt-in:
app.use(createStackPlugin({ default: 'top-layer' }))
Portal reads stack.default as its fallback; a per-component to still wins.
Motivation
Today the only way to teleport a Portal to the top layer is the per-component to="top-layer" prop (packages/0/src/components/Portal/Portal.vue). There's no way to set that default once for the whole app — every overlay has to opt in individually.
Scope
- Add
default?: Extensible<'top-layer'> | HTMLElement to the stack plugin options.
- Expose it on the stack context (
stack.default).
Portal.vue: to resolves to props.to ?? stack.default ?? 'body' (per-component to still wins).
- Test: plugin option flows through to a Portal with no explicit
to.
- Docs note on the
useStack page.
Follow-up to #279/#397 (asked 2026-06-29). Small: plugin option + Portal wiring + test + docs note.
Summary
Add a
defaultTeleportoption tocreateStackPluginso all Portals inherit a teleport target app-wide, without per-component opt-in:Portal reads
stack.defaultas its fallback; a per-componenttostill wins.Motivation
Today the only way to teleport a Portal to the top layer is the per-component
to="top-layer"prop (packages/0/src/components/Portal/Portal.vue). There's no way to set that default once for the whole app — every overlay has to opt in individually.Scope
default?: Extensible<'top-layer'> | HTMLElementto the stack plugin options.stack.default).Portal.vue:toresolves toprops.to ?? stack.default ?? 'body'(per-componenttostill wins).to.useStackpage.Follow-up to #279/#397 (asked 2026-06-29). Small: plugin option + Portal wiring + test + docs note.