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-menuUsage
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
| Prop | Type | Default |
|---|---|---|
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[] | — |
activeKeyControlled active tab. | string | — |
defaultActiveKeyStarting tab when uncontrolled. | string | first tab |
onTabPressCalled when a tab is pressed. | (key: string) => void | — |
avatarPhoto in the avatar slot. | ImageSourcePropType | — |
avatarRingColorRing around the avatar. | string | "#e07a3a" |
widthWidth of the bar and menu. | number | 260 |
bottomInsetExtra space under the bar, e.g. the safe-area bottom. | number | 0 |
veilColorColour that veils the screen while the menu is open. | string | "#ffffff" |