BottomNav
Mobile bottom tab bar for the 3-5 primary destinations of an app shell, with an active tab, count badges and safe-area padding.
Design intent
Mobile apps put primary navigation within thumb reach at the bottom of the screen, but hand-rolled bars drift on target size, active state and the iOS home indicator. BottomNav owns the landmark, the aria-current state, 44px minimum targets and env(safe-area-inset-bottom) so every mobile shell behaves the same.
npx @slipstream-ui/cli@latest add bottom-navProps
| Prop | Type | Default | Description |
|---|---|---|---|
| items | BottomNavItem[] | required | Tabs in order: href, label, optional icon, active, badge and disabled. |
| linkComponent | React.ElementType | — | Router link component (Next Link, react-router Link). |
| linkHrefProp | 'href' | 'to' | 'href' | Prop used to pass the destination to linkComponent. |
| label | string | 'Primary' | Accessible label for the nav landmark. |
| fixed | boolean | true | Pin the bar to the bottom edge with safe-area padding. |
| mobileOnly | boolean | true | Hide the bar from the md breakpoint up. |
Anti-patterns
validate_usage is the MCP tool that rejects these mistakes: the same list agents see over MCP and in the canonical markdown.
Don't stack more than five tabs
Targets stop being thumb-reachable and labels start truncating. Move the extras into a More destination.
tsx// Avoid<BottomNav items={eightItems} />// Prefer 3-5 items plus a More tabDon't use BottomNav for desktop navigation
mobileOnly hides the bar at md and up; desktop keeps SiteHeader/Sidebar.
tsx// Avoid<BottomNav items={items} mobileOnly={false} />// Prefer desktop nav in SiteHeader or Sidebar
Accessibility
- Renders a nav landmark named by label (default "Primary").
- Only the active tab carries aria-current="page".
- Every tab is at least 56px tall with a 44px minimum target.
- env(safe-area-inset-bottom) keeps the bar clear of the iOS home indicator.
Content guidelines
Tab labels
- One word where possible
- Sentence case
- Under 12 characters
Good examples
- Home
- Search
- Alerts
Bad examples
- Go to the alerts page
Composition
Compose with AppShell: Pair with AppShell and add bottom padding so content is not hidden behind the bar
<AppShell><main className="pb-20">...</main><BottomNav items={items} /></AppShell>
Compose with Badge: Counts ride in the item's badge slot; keep them to a single number
<BottomNav items={[{ href: '/alerts', label: 'Alerts', badge: 3 }]} />
Related components: AppShell, SiteHeader, Badge
Dependencies
What the registry installs alongside this component. Package imports already include these.
npm packages
- class-variance-authority
- clsx
- tailwind-merge
Browser support
| Browser | Tested versions |
|---|---|
| Chrome | 111+ (Mar 2023) |
| Edge | 111+ (Mar 2023) |
| Firefox | 121+ (Dec 2023) |
| Safari | 17.2+: macOS & iOS (Dec 2023) |
Slipstream components rely only on CSS custom properties, Flexbox/Grid, and ARIA, the everyday baseline of the last two years of evergreen releases. Anything newer is progressive enhancement: unsupported browsers keep full functionality with static behavior instead of animations.