Nuxt 2 reached End-of-Life on June 30th, 2024.


The <Teleport> component teleports a component to a different location in the DOM.
The to target of <Teleport> expects a CSS selector string or an actual DOM node. Nuxt currently has SSR support for teleports to body only, with client-side support for other targets using a <ClientOnly> wrapper.

Body Teleport

  <button @click="open = true">
    Open Modal
  <Teleport to="body">
    <div v-if="open" class="modal">
      <p>Hello from the modal!</p>
      <button @click="open = false">

Client-side Teleport

    <Teleport to="#some-selector">
      <!-- content -->
Read and edit a live example in Docs > Examples > Advanced > Teleport.