Skip to main content
Vuetify0 is now in beta!
Vuetify0 Logo
Theme
Mode
Palettes
Accessibility
Vuetify One
Sign in to Vuetify One

Access premium tools across the Vuetify ecosystem — Bin, Play, Studio, and more.

Not a subscriber? See what's included

Portal

Renderless teleport wrapper with automatic z-index stacking.

Usage

Portal wraps Vue’s <Teleport> with automatic useStack integration. Content is teleported to body by default and receives a zIndex via slot props for proper overlay ordering.

Basic

Toggle a floating element that teleports to the body on desktop or renders inline on mobile. Uses disabled with useBreakpoints for responsive behavior. Portal registers with the stack and provides zIndex for proper layering.

Mobile — renders inline below

Anatomy

vue
<script setup lang="ts">
  import { Portal } from '@vuetify/v0'
</script>

<template>
  <Portal />
</template>

Architecture

Portal is a thin abstraction over two existing v0 systems:

Portal Flow

Use controls to zoom and pan. Click outside or press Escape to close.

Portal Flow

When mounted, Portal registers a stack ticket. The ticket’s computed zIndex is exposed as a slot prop. When the component unmounts, the ticket is automatically cleaned up via scope disposal.

The disabled prop controls teleporting — when true, content renders inline instead of being teleported. Stack registration is always active regardless of disabled state.

Examples

Stacking

Each Portal registers its own stack ticket. Add multiple layers to see how useStack assigns incrementing zIndex values — each new Portal layers above the previous one. Layers can be dismissed via the close button or programmatically. The zIndex slot prop updates reactively as layers are added and removed.

0 active layers

Accessibility

Portal is transparent — it adds no DOM elements, ARIA attributes, or keyboard behavior. Accessibility is the responsibility of the content you teleport.

Tip

When teleporting interactive content (modals, menus, notifications), ensure it has proper ARIA roles, keyboard handling, and focus management. Portal handles where content renders, not how it behaves.

FAQ

API Reference

The following API details are for all variations of the Portal component.
Was this page helpful?

Ctrl+/