Menu

Bottom navigation

Mobile tab bar. 3 lengths × 2 themes.

Installation

$ npx uix-ui@latest add bottom-nav

This copies the file into components/ui/bottom-nav.tsx in your project. npx shadcn@latest add @uix/bottom-nav works too.

Usage

bottom-nav.tsx
import { BottomNav, BottomNavItem } from "@/components/ui/bottom-nav";

<div style={{ width: 360, maxWidth: "100%" }}>
  <BottomNav>
    <BottomNavItem href="#shop" icon={<House />} active={tab === "shop"} onClick={go("shop")}>Shop</BottomNavItem>
    <BottomNavItem href="#search" icon={<Search />} active={tab === "search"} onClick={go("search")}>Search</BottomNavItem>
    <BottomNavItem href="#saved" icon={<Star />} active={tab === "saved"} onClick={go("saved")}>Saved</BottomNavItem>
    <BottomNavItem href="#me" icon={<User />} active={tab === "me"} onClick={go("me")}>Me</BottomNavItem>
  </BottomNav>
</div>

Props

Bottom navigation props

PropTypeDefaultDescription
themelight | dark"light"

BottomNavItemProps

PropTypeDefaultDescription
iconReact.ReactNode–Icon above the label.
activebooleanfalseMarks the current tab.

Everything else is passed to the root element, so className, aria-* and event handlers work as usual.

Dependencies

Installed for you by the CLI.

  • class-variance-authority
  • clsx
  • tailwind-merge
  • lib/utils.ts
This file exports 2 parts: BottomNav, BottomNavItem. Use only the ones you need.
esc

↑↓ to navigate · ↵ to select · esc to close