Tac UIv1.1.2

FloatingMenuBar

A floating bottom navigation bar for mobile apps. Supports animated tab selection, icon badges, and glass-style backgrounds.

Import

tsx
import { FloatingMenuBar } from '@tac-ui/native';

Basic Usage

Define menu items with key, icon render function, and label. The active tab animates with spring physics.

FloatingMenuBar is positioned absolutely at the bottom of its container. Wrap your screen content and the menu bar in a flex container.

tsx
import { Home, Search, Bell, User } from '@tac-ui/icon-native';

const items = [
  { key: 'home', icon: (p) => <Home {...p} />, label: 'Home' },
  { key: 'search', icon: (p) => <Search {...p} />, label: 'Search' },
  { key: 'inbox', icon: (p) => <Bell {...p} />, label: 'Inbox', badge: 3 },
  { key: 'profile', icon: (p) => <User {...p} />, label: 'Profile' },
];

<FloatingMenuBar
  items={items}
  activeKey="home"
  onSelect={(key) => setActiveKey(key)}
/>

Glass Variant

Use the glass prop for a translucent frosted background that blends with content behind it.

The glass variant uses a semi-transparent background, ideal for overlaying rich content.

tsx
<FloatingMenuBar
  items={items}
  activeKey="home"
  onSelect={setActiveKey}
  glass
/>

API Reference

PropTypeDefaultDescription
itemsFloatingMenuBarItem[]-Array of menu items with key, icon, label, and optional badge.
activeKeystring-Key of the currently active tab.
onSelect(key: string) => void-Called when a menu item is pressed.
glassbooleanfalseUses a translucent glass-style background.

FloatingMenuBarItem

PropTypeDefaultDescription
keystring-Unique identifier for the tab.
icon(props: { color, size }) => ReactNode-Icon render function receiving color and size.
labelstring-Text label shown below the icon.
badgenumber-Badge count displayed on the icon.