V Vultra UI

Tab Bar

A fixed bottom navigation bar for mobile apps. TabBar pins to the bottom with an optional backdrop blur and safe-area padding; TabBarItem renders a tab with icon, label, and an optional badge.

Usage

<script>
  import { TabBar, TabBarItem } from '@vultra/ui';
  import { Home, Search, Plus, User } from 'lucide-svelte';

  let active = $state('home');
</script>

<TabBar bind:value={active}>
  <TabBarItem value="home" label="Home" icon={() => <Home />} />
  <TabBarItem value="search" label="Search" icon={() => <Search />} />
  <TabBarItem value="profile" label="Profile" icon={() => <User />} badge={3} />
</TabBar>

Props

TabBar

PropTypeDefaultDescription
valuestring \| number—Bindable active tab value
blurbooleantrueBackdrop blur behind the bar
classstring—Additional CSS classes
childrenSnippet—TabBarItems

TabBarItem

PropTypeDefaultDescription
valuestring \| number—Tab value, compared against the parent’s
labelstring—Tab label
iconSnippet—Optional icon
badgenumber—Badge count; caps display at 99+
onclick(e: MouseEvent) => void—Click handler
activeboolean—Override the parent’s value comparison
classstring—Additional CSS classes

Features

  • Fixed bottom bar with env(safe-area-inset-bottom) padding.
  • Active tab highlighted with the primary token; aria-selected reflects state.
  • Badges with 99+ overflow cap.
  • Backdrop blur when blur is enabled.