Components/TabBar
Universal Component

TabBar

Bottom tab navigation with icons, badges, and safe-area support.

This page was migrated by AI, please review carefully

Migration is complete, but please validate against source code and manual review.

TabBar

TxTabBar renders app-style bottom navigation. It manages a v-model value, exposes tab semantics for each item, supports badges, and can reserve the device safe-area inset when it is fixed to the viewport bottom.

Basic Usage

TabBar

Demo will load when visible.
<script setup lang="ts">
import { ref } from 'vue'

const value = ref('home')

const items = [
  { value: 'home', label: 'Home', iconClass: 'i-carbon-home' },
  { value: 'search', label: 'Search', iconClass: 'i-carbon-search', badge: 3 },
  { value: 'profile', label: 'Me', iconClass: 'i-carbon-user' },
]
</script>

<template>
  <div style="width: 360px; height: 220px; border: 1px solid var(--tx-border-color); border-radius: 12px; overflow: hidden; position: relative;">
    <div style="padding: 16px; color: var(--tx-text-color-secondary);">
      Active: {{ value }}
    </div>

    <TxTabBar v-model="value" :items="items" />
  </div>
</template>

API

Props

PropTypeDefaultDescription
modelValuestring | number''Active tab value used by v-model.
itemsTabBarItem[][]Tabs rendered from left to right.
fixedbooleantrueFixes the bar to the bottom of the viewport. Disable it when the bar lives inside a framed preview or custom layout.
safeAreaBottombooleantrueAdds an env(safe-area-inset-bottom) spacer below the tab row.
disabledbooleanfalseDisables all tab buttons and suppresses value updates.
zIndexnumber2000CSS z-index written to --tx-tab-bar-z-index.

TabBarItem

FieldTypeDescription
valuestring | numberValue emitted when the tab is selected.
labelstringVisible tab label.
iconClassstringOptional icon class rendered above the label.
badgestring | numberOptional badge displayed on the icon area. Empty values are hidden.
disabledbooleanDisables only this tab item.

Events

EventParamsDescription
update:modelValue(value)Emitted with the picked item value.
change(value)Mirrors the picked value for change listeners.