Vue NativeVue Native
Guide
Components
Composables
Navigation
Architecture
  • iOS
  • Android
  • macOS
GitHub
Guide
Components
Composables
Navigation
Architecture
  • iOS
  • Android
  • macOS
GitHub
  • Device & System

    • useNetwork
    • useAppState
    • useColorScheme
    • useDeviceInfo
    • useBattery
    • useDimensions
    • usePlatform
  • Storage & Files

    • useAsyncStorage
    • useSecureStorage
    • useFileSystem
    • useDatabase
  • Sensors & Hardware

    • useGeolocation
    • useBiometry
    • useHaptics
    • useSensors
    • useBluetooth
  • Media

    • useCamera
    • useImagePicker
    • useAudio
    • useCalendar
    • useContacts
  • Networking

    • useHttp
    • useWebSocket
  • Permissions

    • usePermissions
  • Navigation

    • useBackHandler
    • useSharedElementTransition
  • UI

    • useKeyboard
    • useClipboard
    • useAccessibility
    • useShare
    • useLinking
    • useAnimation
    • useGesture
    • useTeleport
    • useNotifications
    • useI18n
    • usePerformance
    • useInspector
  • Authentication

    • useAppleSignIn
    • useGoogleSignIn
  • Monetization & Updates

    • useIAP
    • useOTAUpdate
    • useBackgroundTask
  • Desktop (macOS)

    • useWindow
    • useMenu
    • useFileDialog
    • useDragDrop

useTeleport

Programmatically teleport native view nodes to different containers (e.g., modal overlay, root view). This is the composable API for the <Teleport> component.

Import

import { useTeleport } from '@thelacanians/vue-native-runtime'

Usage

import { useTeleport, createNativeNode } from '@thelacanians/vue-native-runtime'

const { teleport } = useTeleport('modal')

// Create a view and teleport it to the modal container
const node = createNativeNode('VView')
teleport(node)

API

function useTeleport(target: string): {
  teleport: (node: NativeNode) => void
}

Parameters

ParameterTypeDescription
targetstringTeleport target name. Built-in targets: 'modal', 'root'

Returns

PropertyTypeDescription
teleport(node: NativeNode) => voidFunction that moves the given node to the target container

Teleport Targets

TargetDescription
'root'The root view of the app (top of the view hierarchy)
'modal'A dedicated modal container that overlays the root view

Example: Custom Modal

<script setup>
import { ref } from 'vue'

const showModal = ref(false)

function openModal() {
  showModal.value = true
}
</script>

<template>
  <Teleport to="modal" v-if="showModal">
    <VView :style="{ flex: 1, justifyContent: 'center', alignItems: 'center' }">
      <VText>Modal Content</VText>
      <VButton title="Close" @press="showModal = false" />
    </VView>
  </Teleport>
</template>

Notes

  • Teleported nodes are moved (not copied) — they are removed from their original parent
  • The Teleport component (Vue built-in) uses this mechanism under the hood
  • Teleport markers create native containers that are cleaned up when the teleport is removed
Edit this page
Last Updated: 7/28/26, 4:10 PM
Contributors: github-actions[bot]
Prev
useGesture
Next
useNotifications