Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Shadcn Bottom Navigation for React and Tailwind

Fixed bottom nav for mobile-first apps.

Home

Installation

bunx --bun shadcn@latest add https://kit.dev/r/bottom-navigation.json

Anatomy

BottomNavigation
├── BottomNavigationList
├── BottomNavigationItem
├── BottomNavigationContent
└── BottomNavigationIndicator

Usage

import { BellIcon, HomeIcon, SearchIcon, UserIcon } from "lucide-react";
import {
  BottomNavigation,
  BottomNavigationContent,
  BottomNavigationItem,
  BottomNavigationItemIcon,
  BottomNavigationItemLabel,
  BottomNavigationList,
} from "@/components/ui/bottom-navigation";
const items = [
  { icon: HomeIcon, label: "Home", value: "home" },
  { icon: SearchIcon, label: "Search", value: "search" },
  { icon: BellIcon, label: "News", value: "news" },
  { icon: UserIcon, label: "Profile", value: "profile" },
];

const Example = () => (
  <div className="relative flex h-80 w-full max-w-xs flex-col overflow-hidden rounded-xl border bg-background shadow-lg/5">
    <BottomNavigation
      className="flex h-full min-h-0 flex-col"
      defaultValue="home"
    >
      {items.map((item) => (
        <BottomNavigationContent
          className="flex min-h-0 flex-1 items-center justify-center bg-muted"
          key={item.value}
          value={item.value}
        >
          <span className="text-muted-foreground text-sm">{item.label}</span>
        </BottomNavigationContent>
      ))}
      <BottomNavigationList className="static bg-background">
        {items.map((item) => (
          <BottomNavigationItem key={item.value} value={item.value}>
            <BottomNavigationItemIcon>
              <item.icon />
            </BottomNavigationItemIcon>
            <BottomNavigationItemLabel>{item.label}</BottomNavigationItemLabel>
          </BottomNavigationItem>
        ))}
      </BottomNavigationList>
    </BottomNavigation>
  </div>
);

Accessibility

KeyDescription
ArrowDown
Move to the next item when orientation is "vertical".
ArrowUp
Move to the previous item when orientation is "vertical".
ArrowLeft
Move to the previous item when orientation is "horizontal".
ArrowRight
Move to the next item when orientation is "horizontal".
Home
Go to the start.
End
Go to the end.
Enter
Activate the focused control.
Space
Activate the focused control.

Demos

Controlled

Disabled

Icon Only

Root Provider

With Badge

API Reference

BottomNavigation

div

PropType
AttributeType
CSS variableType

BottomNavigationList

PropType
AttributeType

BottomNavigationItem

PropType
AttributeType

BottomNavigationContent

PropType
AttributeType

BottomNavigationItemIcon

span

PropType
AttributeType

BottomNavigationItemLabel

span

PropType
AttributeType

BottomNavigationRootProvider

div

PropType
AttributeType
CSS variableType

useBottomNavigation

BottomNavigationContext