Skip to content

Tabbar Bottom Navigation Bar

Bottom main navigation bar. Supports 2-5 tab switching, center raised button, Badge/Dot badges, route mode, and safe area adaptation.

Basic Usage

vue
<template>
  <see-tabbar v-model="activeTab" :tabs="tabs" />
</template>

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

const activeTab = ref('home')
const tabs = [
  { name: 'home', text: 'Home', icon: '🏠' },
  { name: 'category', text: 'Category', icon: '📂' },
  { name: 'cart', text: 'Cart', icon: '🛒' },
  { name: 'mine', text: 'Profile', icon: '👤' }
]
</script>

Badge/Dot

vue
<template>
  <see-tabbar v-model="activeTab" :tabs="tabs" />
</template>

<script setup>
const tabs = [
  { name: 'home', text: 'Home', icon: '🏠' },
  { name: 'msg', text: 'Messages', icon: '💬', badge: 99 },
  { name: 'cart', text: 'Cart', icon: '🛒', dot: true }
]
</script>

Center Raised Button

vue
<template>
  <see-tabbar v-model="activeTab" :tabs="tabs" @on-center-click="onCenterClick" />
</template>

<script setup>
const tabs = [
  { name: 'home', text: 'Home', icon: '🏠' },
  { name: 'publish', text: 'Publish', icon: '➕', isCenter: true, centerIcon: '✚' },
  { name: 'mine', text: 'Profile', icon: '👤' }
]

const onCenterClick = () => {
  uni.navigateTo({ url: '/pages/publish/index' })
}
</script>

TabbarItem

PropertyTypeDescription
namestring | numberUnique identifier
textstringDisplay text
iconstringIcon name
activeIconstringIcon name when active
badgestring | numberBadge content
dotbooleanWhether to show red dot
isDisabledbooleanWhether disabled
urlstringPage path in route mode
isCenterbooleanWhether it's a center raised button
centerIconstringCenter button icon

Props

PropertyTypeDefaultDescription
modelValuestring | number''Currently active tab name
tabsTabbarItem[][]Tab list
isFixedbooleantrueWhether fixed at bottom
isFrostedbooleanfalseWhether to enable frosted glass effect
zIndexnumber990z-index
safeAreaInsetBottombooleantrueWhether to adapt to bottom safe area
activeColorstring''Color when active
inactiveColorstring''Color when inactive
bgColorstring''Custom background color
borderbooleantrueWhether to show top border
routebooleanfalseWhether in route mode
placeholderbooleantrueWhether to generate placeholder when fixed

Events

EventParametersDescription
onChangename, indexTab switch
onClickname, indexTab click (before switch)
onCenterClick-Center button click
update:modelValuevaluev-model update

Expose

MethodParametersDescription
switchTabnameSwitch tab
setBadgename, badgeSet badge
clearBadgenameClear badge

Liao ICP No. 2025070134