Skip to content

[Feature Request] createStackPlugin: app-wide defaultTeleport option #553

Description

@johnleider

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions