Vue NativeVue Native
Guide
Components
Composables
Navigation
  • iOS
  • Android
  • macOS
GitHub
Guide
Components
Composables
Navigation
  • iOS
  • Android
  • macOS
GitHub
  • Layout

    • VView
    • VScrollView
    • VSafeArea
    • VKeyboardAvoiding
  • Text & Input

    • VText
    • VInput
  • Interactive

    • VButton
    • VPressable
    • VSwitch
    • VSlider
    • VSegmentedControl
    • VCheckbox
    • VRadio
    • VDropdown
    • VRefreshControl
  • Media

    • VImage
    • VWebView
    • VVideo
  • Lists

    • VList
    • VFlatList
    • VSectionList
  • Feedback

    • VActivityIndicator
    • VProgressBar
    • VAlertDialog
    • VActionSheet
    • VModal
    • VErrorBoundary
  • Transition & State

    • VTransition & VTransitionGroup
    • KeepAlive
    • VSuspense
  • Navigation

    • VNavigationBar
    • VTabBar
  • System

    • VStatusBar
    • VPicker
  • macOS

    • VToolbar
    • VSplitView
    • VOutlineView

VTabBar

A tab bar component for switching between screens. Renders a row of tappable tabs at the bottom of the screen. Supports v-model for two-way binding of the active tab.

Usage

<VTabBar
  v-model="activeTab"
  :tabs="[
    { name: 'home', label: 'Home', icon: 'house' },
    { name: 'settings', label: 'Settings', icon: 'gear' },
  ]"
/>

Props

PropTypeDefaultDescription
tabsTabBarItem[]requiredArray of tab definitions
modelValuestring''The name of the active tab (use with v-model)
activeColorstring'#007AFF'Color of the active tab icon and label
inactiveColorstring'#8E8E93'Color of inactive tab icons and labels
backgroundColorstring'#F9F9F9'Background color of the tab bar

TabBarItem

interface TabBarItem {
  name: string      // Unique identifier for the tab
  label?: string    // Display label below the icon
  icon?: string     // Icon name (platform-specific)
}

Events

EventPayloadDescription
@update:modelValuestringEmitted when the active tab changes (used by v-model)

Example

<script setup>
import { ref } from '@thelacanians/vue-native-runtime'

const activeTab = ref('home')
</script>

<template>
  <VView :style="{ flex: 1 }">
    <VView :style="{ flex: 1, padding: 16 }">
      <VText v-if="activeTab === 'home'">Home Screen</VText>
      <VText v-if="activeTab === 'search'">Search Screen</VText>
      <VText v-if="activeTab === 'profile'">Profile Screen</VText>
    </VView>

    <VTabBar
      v-model="activeTab"
      :tabs="[
        { name: 'home', label: 'Home', icon: 'house' },
        { name: 'search', label: 'Search', icon: 'magnifyingglass' },
        { name: 'profile', label: 'Profile', icon: 'person' },
      ]"
      activeColor="#007AFF"
      inactiveColor="#8E8E93"
      backgroundColor="#FFFFFF"
    />
  </VView>
</template>

With Tab Navigator

VTabBar is most commonly used with createTabNavigator, which handles screen switching automatically:

<script setup>
import { createTabNavigator, VTabBar, RouterView } from '@thelacanians/vue-native-navigation'
import HomeScreen from './pages/Home.vue'
import SettingsScreen from './pages/Settings.vue'

const tabs = createTabNavigator({
  tabs: [
    { name: 'home', component: HomeScreen, label: 'Home', icon: 'house' },
    { name: 'settings', component: SettingsScreen, label: 'Settings', icon: 'gear' },
  ],
})
</script>

<template>
  <VView :style="{ flex: 1 }">
    <RouterView />
    <VTabBar
      v-model="tabs.activeTab.value"
      :tabs="tabs.tabItems"
    />
  </VView>
</template>

Notes

  • VTabBar is exported from @thelacanians/vue-native-navigation, not the runtime package.
  • The tab bar renders at the bottom of the screen. It does not automatically account for the safe area — wrap it in a VSafeArea or add bottom padding on devices with home indicators.
  • Icon names are platform-specific: SF Symbols on iOS, Material Icons on Android.
Edit this page
Last Updated: 2/28/26, 11:24 PM
Contributors: Abdul Hamid, Claude Opus 4.6
Prev
VNavigationBar