Vue NativeVue Native
Guide
Components
Composables
Navigation
  • iOS
  • Android
GitHub
Guide
Components
Composables
Navigation
  • iOS
  • Android
GitHub
  • Getting Started

    • Introduction
    • Installation
    • Your First App
    • Project Structure
  • Core Concepts

    • Components
    • Styling
    • Navigation
    • Native Modules
    • Hot Reload
  • Building & Releasing

    • Building for Release

Navigation

Vue Native includes stack-based navigation via @thelacanians/vue-native-navigation.

Setup

// app/main.ts
import { createApp } from '@thelacanians/vue-native-runtime'
import { createRouter } from '@thelacanians/vue-native-navigation'
import App from './App.vue'
import HomeView from './views/HomeView.vue'
import DetailView from './views/DetailView.vue'

const router = createRouter([
  { name: 'home', component: HomeView },
  { name: 'detail', component: DetailView },
])

createApp(App).use(router).start()

Root component

<!-- App.vue -->
<template>
  <RouterView />
</template>

Navigating

<!-- HomeView.vue -->
<script setup>
import { useRouter } from '@thelacanians/vue-native-navigation'
const router = useRouter()
</script>

<template>
  <VView style="flex: 1">
    <VButton @press="router.push('detail', { id: 42 })">
      <VText>Go to Detail</VText>
    </VButton>
  </VView>
</template>

Reading params

<!-- DetailView.vue -->
<script setup>
import { useRoute } from '@thelacanians/vue-native-navigation'
const route = useRoute()
// route.params.id === 42
</script>

API

createRouter(routes)

Creates a router instance. Call once at app startup.

const router = createRouter([
  { name: 'home', component: HomeView },
  { name: 'detail', component: DetailView },
])

useRouter()

Returns the router instance.

MethodDescription
router.push(name, params?)Navigate to a screen
router.pop()Go back to the previous screen
router.replace(name, params?)Replace current screen (no back entry)
router.reset(name, params?)Reset the stack to a single screen

useRoute()

Returns the current route.

PropertyTypeDescription
route.namestringCurrent screen name
route.paramsRecord<string, any>Navigation params
Edit this page
Last Updated: 2/23/26, 5:58 AM
Contributors: Abdul Hamid, Claude Sonnet 4.6, Claude Opus 4.6
Prev
Styling
Next
Native Modules