shadcn.io is not affiliated with official shadcn/ui
Framework
UI library
Radix UI does not include this primitive, so this page uses the Ark UI component. The visuals match the Ark UI version.
Home
Installation
bunx --bun shadcn@latest add https://kit.dev/r/radix/bottom-navigation.jsonAnatomy
BottomNavigation
├── BottomNavigationList
├── BottomNavigationItem
├── BottomNavigationContent
└── BottomNavigationIndicatorUsage
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
| Key | Description |
|---|---|
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
With Links
API Reference
BottomNavigation
div
PropType
AttributeType
CSS variableType
--spacingstringBottomNavigationList
PropType
AttributeType
BottomNavigationItem
PropType
AttributeType
BottomNavigationContent
PropType
AttributeType
BottomNavigationItemIcon
span
PropType
AttributeType
BottomNavigationItemLabel
span
PropType
AttributeType
BottomNavigationRootProvider
div
PropType
AttributeType
CSS variableType
--spacingstring