Skip to content

Tabbar

Demo

Tabbar 跨端示例与演示

HomeHome

Overview, recommendations, and recent activity.

Basic Usage

vue
<script setup lang="ts">
import { VTabbar, VTabbarItem } from '@varo-ui/h5'
import { shallowRef } from 'vue'

const active = shallowRef('home')
</script>

<template>
  <VTabbar v-model="active" aria-label="Primary navigation">
    <VTabbarItem name="home">
      <template #icon>
        <img src="/icons/home.svg" alt="">
      </template>
      Home
    </VTabbarItem>
    <VTabbarItem name="messages" badge="2">
      <template #icon>
        <img src="/icons/message.svg" alt="">
      </template>
      Messages
    </VTabbarItem>
    <VTabbarItem name="profile" dot>
      <template #icon>
        <img src="/icons/profile.svg" alt="">
      </template>
      Profile
    </VTabbarItem>
  </VTabbar>
</template>

VTabbar Props

PropTypeDefaultDescription
modelValuestring | numberundefinedSelected item
fixedbooleanfalseFix to bottom
borderbooleantrueShow border
safeAreaInsetBottombooleanfalseEnable bottom safe area

VTabbar Events

EventPayloadDescription
update:modelValuestring | numberSelected item changed
changestring | numberSelected item changed

VTabbarItem Props

PropTypeDefaultDescription
namestring | number-Item name
iconstringundefinedIcon text or icon name
badgestring | numberundefinedBadge
dotbooleanfalseShow red dot

VTabbarItem Slots

SlotDescription
defaultItem label
iconCustom icon, treated as decorative in the accessibility tree