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

useInspector

Introspect the live native view tree — useful for debugging layout and building devtools. The tree is serialized by the native Inspector module, which walks its view registry.

API

const { dumpTree } = useInspector()
MethodSignatureDescription
dumpTree() => Promise<ViewTreeNode | null>Dump the current native view tree (root node with nested children), or null on failure.

ViewTreeNode

interface ViewTreeNode {
  id: number                                    // native node id
  type: string                                  // e.g. "VView", "VText"
  props?: Record<string, unknown>               // props set on the node
  frame?: { x: number; y: number; width: number; height: number }
  children?: ViewTreeNode[]
}

Example

<script setup lang="ts">
import { useInspector, VButton } from '@thelacanians/vue-native-runtime'

const { dumpTree } = useInspector()

async function logTree() {
  const tree = await dumpTree()
  console.log(JSON.stringify(tree, null, 2))
}
</script>

<template>
  <VButton title="Dump view tree" @press="logTree" />
</template>

Notes

  • The tree reflects the native view hierarchy (frames are in the parent's coordinate space).
  • Returns null if the Inspector module is unavailable.
Edit this page
Last Updated: 7/28/26, 10:38 PM
Contributors: Abdul Hamid
Prev
usePerformance