Mobile Bottom Navigation

App-style tailwind bottom navigation bar with five tabs and an active indicator.

Tailwind CSS
<nav class="w-full max-w-md mx-auto bg-white border-t border-slate-200 px-2 py-1 flex justify-around" aria-label="Mobile navigation">
  <a href="#" class="flex flex-col items-center gap-1 px-4 py-2 text-indigo-600">
    <svg class="w-6 h-6" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M3 12l9-9 9 9M5 10v10h5v-6h4v6h5V10"/></svg>
    <span class="text-[10px] font-bold">Home</span>
  </a>
  <a href="#" class="flex flex-col items-center gap-1 px-4 py-2 text-slate-400 hover:text-slate-600 transition-colors">
    <svg class="w-6 h-6" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><circle cx="11" cy="11" r="7"/><path stroke-linecap="round" d="M21 21l-4.3-4.3"/></svg>
    <span class="text-[10px] font-bold">Search</span>
  </a>
  <a href="#" class="flex flex-col items-center gap-1 px-4 py-2 text-slate-400 hover:text-slate-600 transition-colors">
    <svg class="w-6 h-6" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/></svg>
    <span class="text-[10px] font-bold">Orders</span>
  </a>
  <a href="#" class="flex flex-col items-center gap-1 px-4 py-2 text-slate-400 hover:text-slate-600 transition-colors">
    <svg class="w-6 h-6" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><circle cx="12" cy="8" r="4"/><path stroke-linecap="round" d="M4 21c0-4 3.6-6 8-6s8 2 8 6"/></svg>
    <span class="text-[10px] font-bold">Profile</span>
  </a>
</nav>

Free to use in personal and commercial projects. No attribution required.

Variants

Same component, different looks. Preview each one live and copy the code you like.

Dark

For dark mobile apps where a white bar breaks immersion.

Tailwind CSS

Center action

Raised center button for the primary action like posting or scanning.

Tailwind CSS

Icon only

No labels for extra compact bars on small phones.

Tailwind CSS

About this mobile bottom navigation

A tailwind bottom navigation bar is the thumb-friendly tab bar from mobile apps, pinned to the bottom of the screen with three to five destinations. The mobile bottom nav html css pattern puts primary sections in the natural thumb zone, which is why app-like mobile sites and PWAs use it instead of squeezing a top navbar onto a phone.

This bottom tab bar tailwind snippet is a horizontal flex row of icon-plus-label tabs. The active tab gets the brand color while inactive tabs sit in muted slate, so the current section is obvious at a glance. Tiny 10px bold labels under 24px icons keep every tab legible without crowding, and justify-around spacing gives each tab an equal, generous touch target.

Limit it to five tabs maximum; more than that and labels shrink into unreadability. In production, pin it with fixed bottom-0 and add bottom padding to your page content so nothing hides behind it. Respect the iPhone home indicator with pb-[env(safe-area-inset-bottom)] so the bar never collides with the system gesture area.

Phones are thumb-operated, and the top of the screen is the hardest place to reach one-handed. Squeezing a desktop navbar onto a phone forces constant hand gymnastics for the most common destinations. The bottom nav moves the three to five core sections into the natural thumb arc at the screen's base. Home, search, and profile become one comfortable tap instead of a stretch.

The bar is pinned with fixed bottom-0 left-0 right-0, and justify-around gives each tab an equal, generous touch target. Each tab pairs a 24px icon with a tiny bold label so the destination is never ambiguous. The active tab takes the brand color with a filled icon variant while inactive tabs stay muted with outline icons. Using filled versus outline, not just color, keeps the state readable for color-blind users.

Pad the bar with env(safe-area-inset-bottom) so it clears the iPhone home indicator; without it, the bar sits under the gesture zone and taps misfire. Keep labels always visible next to icons; icon-only tabs force users to memorize positions, and memory fails. When a tab has a badge count, cap the display at 9+; exact counts above nine add noise, not information. On tablets in landscape, consider moving to a side rail; bottom nav on wide screens wastes the thumb zone's advantage.

Deep links break the active state. A visitor opens a shared link straight to the Search tab, but the bar still highlights Home because the active class was hardcoded. Every tab switch, including back-button navigation, must sync the highlight to the actual route. Derive the active tab from the current URL on every render, not from the last tab the user tapped.

Where to use it

  • ✓ Mobile web apps and PWAs
  • ✓ E-commerce mobile storefronts
  • ✓ Social and community apps
  • ✓ Food delivery and booking apps

Customization tips

Add a small dot badge on tabs with unread counts, positioned absolute over the icon. Swap the active color to your brand, or use a filled icon variant for the active tab. For a floating look, wrap the bar in a rounded-full container with margins and a shadow.

Design notes

When to use

Bottom navigation fits mobile apps and mobile-first sites with three to five core destinations, because the thumb zone at the screen bottom is the easiest reach on a phone. Home, search, and profile are the classic residents. It works when those destinations are peers the visitor switches between constantly.

What to avoid

Do not exceed five tabs, because targets shrink below thumb size and labels truncate into mystery. Avoid using bottom nav on desktop layouts, where it looks lost and wastes the natural top navigation space. And do not bury your primary conversion action in a tab, since tabs signal browsing, not doing.

Accessibility

Mark the bar as navigation with an accessible label, set aria-current on the active tab, and announce badge counts like 3 unread in the tab label. Keep every touch target at least 44 pixels tall.

Frequently asked questions

How do I make a tailwind bottom navigation bar stay fixed while scrolling?

Give the nav fixed bottom-0 left-0 right-0 with a high z-index, and add matching padding-bottom to your main content so the last items are never hidden behind the bar. Include the safe-area inset for phones with gesture bars.

How many tabs should a bottom nav have?

Three to five. That range fits comfortably on a 360px wide phone with readable labels. If you have more sections, put the overflow behind a 'More' tab that opens a sheet or menu.

Should bottom nav appear on desktop too?

No. Hide it above the sm or md breakpoint with sm:hidden and show a top navbar instead. Bottom navigation is a mobile pattern; on desktop it wastes vertical space and looks out of place.

Should the bottom nav hide when the user scrolls down?

Hiding on scroll down and revealing on scroll up frees screen space on content-heavy pages. Keep it always visible in apps where switching tabs is the primary action. Use a translate-y transition so the hide feels smooth instead of jumpy.

How do I stop page content from hiding behind a fixed bottom nav?

Add padding-bottom to the body equal to the nav height so the last content never sits underneath it. Include env(safe-area-inset-bottom) in that calculation so the nav clears the iPhone home indicator. Forgetting the safe area is the most common cause of bottom nav overlapping content on modern phones.

How do I show which tab is active in a bottom nav?

Give the active tab your brand color plus a filled icon variant, while inactive tabs stay muted with outline icons. Also set aria-current="page" on the active link so screen readers announce the current section. Color alone is not enough, since some users cannot perceive the difference.