---
source: https://iinventedlight.com/library/notes/vue-teleport.md
title: "Render a Vue Teleport or a React portal outside the parent DOM tree"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (Vue docs); CC-BY-4.0 (React docs); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Vue docs, Teleport; React docs, createPortal. CC-BY-4.0; CC-BY-4.0."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-19
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-19
as_of: 2026-11-19
confidence: medium
untested: "Not reproduced (2026-11-19). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-web: Vue Teleport and React createPortal"
tags: [vue, teleport, react, portal, dom]
client: Librarian
sources:
  - id: S1
    title: "Teleport"
    publisher: Vue docs
    url: https://vuejs.org/guide/built-ins/teleport.html
    accessed: 2026-11-19
    license: "CC-BY-4.0"
  - id: S2
    title: "createPortal"
    publisher: React docs
    url: https://react.dev/reference/react-dom/createPortal
    accessed: 2026-11-19
    license: "CC-BY-4.0"
---
# Render a Vue Teleport or a React portal outside the parent DOM tree
**Answer:** Vue's `<Teleport>` is a built-in component that sends part of a component template into a DOM node that exists outside that component's DOM hierarchy. React's `createPortal` does the same kind of thing: it lets you render some children into a different part of the DOM. Both are commonly used for full-screen modals.

## Vue Teleport

The guide notes that a modal's button and the modal itself often belong in the same single-file component, because they share open and close state. `<Teleport>` keeps that logical grouping and still displays the modal elsewhere, even outside the Vue application.

## React createPortal

`createPortal` takes the children, a DOM node, and an optional key. The children still belong to the React tree of the parent component, but they appear under the given DOM node. A modal is a common case.

| Teleport | createPortal |
|---|---|
| Teleport | Built-in Vue component that moves template output |
| createPortal | React API that renders children elsewhere in the DOM |
| modal | Common case for both APIs |
| target DOM node | Exists outside the parent component hierarchy |

## See also

- [vue-single-file-components](https://iinventedlight.com/library/notes/vue-single-file-components/)
- [vue-slots](https://iinventedlight.com/library/notes/vue-slots/)
- [react-refs](https://iinventedlight.com/library/notes/react-refs/)

## Claims

- id: C1
  claim: Teleport is a built-in Vue component that moves part of a template to a DOM node outside the component's tree.
  source: S1
  evidence: "built-in component that allows us"

- id: C2
  claim: The target node can exist outside the Vue application's DOM hierarchy.
  source: S1
  evidence: "DOM node that exists outside"

- id: C3
  claim: React's createPortal renders children into a different part of the DOM.
  source: S2
  evidence: "render some children into a different part of the DOM"

## Sources

- [S1] Teleport. Vue docs. https://vuejs.org/guide/built-ins/teleport.html . License: CC-BY-4.0. Accessed 2026-11-19.

- [S2] createPortal. React docs. https://react.dev/reference/react-dom/createPortal . License: CC-BY-4.0. Accessed 2026-11-19.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Vue docs, Teleport; React docs, createPortal. CC-BY-4.0; CC-BY-4.0. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
