UIR

TabBarMenu

A floating pill tab bar whose avatar opens a menu. The panel grows out of the avatar corner from grey to black, rows fade in one by one, the avatar becomes ••• and the screen behind is veiled.

Preview

Preview coming soon

Try it live: run the CLI command below in an Expo app, or open the Code tab.

Installation

npx @codewithrabby/ui@latest add tab-bar-menu

Usage

import { TabBarMenu } from "@/components/uir/tab-bar-menu";
import { House, LayoutGrid, History, Settings } from "lucide-react-native";

<View style={{ flex: 1 }}>
  {/* your screen content */}
  <TabBarMenu
    bottomInset={insets.bottom}
    avatar={require("./me.jpg")}
    tabs={[
      { key: "home", icon: House, label: "Home" },
      { key: "apps", icon: LayoutGrid, label: "Apps" },
    ]}
    onTabPress={(key) => setTab(key)}
    menu={[
      { label: "Order History", icon: History, onPress: () => router.push("/orders") },
      { label: "Settings", icon: Settings, onPress: () => router.push("/settings") },
    ]}
  />
</View>

Props

PropTypeDefault
tabs

{ key, icon, label? }. icon is any lucide icon; label is read by screen readers.

TabBarTab[]—
menu

{ label, icon, onPress? } rows in the avatar menu. Pressing one closes the menu.

TabBarMenuItem[]—
activeKey

Controlled active tab.

string—
defaultActiveKey

Starting tab when uncontrolled.

stringfirst tab
onTabPress

Called when a tab is pressed.

(key: string) => void—
avatar

Photo in the avatar slot.

ImageSourcePropType—
avatarRingColor

Ring around the avatar.

string"#e07a3a"
width

Width of the bar and menu.

number260
bottomInset

Extra space under the bar, e.g. the safe-area bottom.

number0
veilColor

Colour that veils the screen while the menu is open.

string"#ffffff"