Skip to main content
Clever Ops

Bottom Tabs Navbar

App-style React navigation, a thumb-reach bottom tab bar with a raised primary action on mobile that becomes a top Tailwind glass bar on desktop; one landmark, safe-area aware.

Preview & code

Loading Bottom Tabs Navbar preview

Installation

pnpm dlx shadcn@latest add @cleverui/navbar-bottom-tabs

Requires the @cleverui registry in your components.json, a one-off, two-line setup.

Usage

tsx
import { NavbarBottomTabs } from '@/components/blocks/navbar-bottom-tabs'
Exampletsx
'use client'

import { useEffect, useState } from 'react'
import { Home, Search, Bookmark, User, Plus } from 'lucide-react'
import { NavbarBottomTabs } from '@/components/blocks/navbar-bottom-tabs'

const LINKS = [
  { label: 'Home', href: '#home', icon: Home },
  { label: 'Browse', href: '#browse', icon: Search },
  { label: 'Saved', href: '#saved', icon: Bookmark },
  { label: 'Profile', href: '#profile', icon: User },
]

const PAGES: Record<string, { title: string; body: string; meta: string }> = {
  '#home': {
    meta: 'Field Notes · Today',
    title: 'Twelve routes near the waterfront',
    body: 'Quiet morning light on the Embarcadero loop. Three new pins from the cartography team, and a steep grade alert on the Twin Peaks connector.',
  },
  '#browse': {
    meta: 'Catalog · 248 routes',
    title: 'Filter by surface, grade, and shade',
    body: 'Packed dirt, boardwalk, and granite stairs. Sort by elevation gain or by how many riders finished under forty minutes last weekend.',
  },
  '#saved': {
    meta: 'Library · 19 collections',
    title: 'Weekend recovery loops',
    body: 'Six under 8 km, all with a coffee stop within 400 m of the trailhead. Shared with the East Bay group last Thursday.',
  },
  '#profile': {
    meta: 'Account · Miles Chen',
    title: '142 km this month',
    body: 'Personal best on the Marin Headlands ridge: 1h 18m. Strava sync is current; export last week’s GPX from Settings.',
  },
}

export default function NavbarBottomTabsDemo() {
  const [active, setActive] = useState('#home')
  const page = PAGES[active] ?? PAGES['#home']!

  // Demo-only: keep the active tab in sync without a real router
  useEffect(() => {
    const onClick = (e: MouseEvent) => {
      const anchor = (e.target as HTMLElement).closest('a')
      if (!anchor) return
      const href = anchor.getAttribute('href')
      if (!href || !href.startsWith('#')) return
      if (href === '#compose') return
      e.preventDefault()
      if (LINKS.some((l) => l.href === href)) setActive(href)
    }
    document.addEventListener('click', onClick)
    return () => document.removeEventListener('click', onClick)
  }, [])

  return (
    <div className="relative min-h-[640px] bg-background">
      <NavbarBottomTabs
        brand={
          <span className="inline-flex items-baseline gap-1.5">
            Trailmark
            <span className="font-mono text-[10px] uppercase tracking-[0.2em] text-muted-foreground">
              maps
            </span>
          </span>
        }
        links={LINKS}
        active={active}
        action={{ label: 'New route', href: '#compose', icon: Plus }}
      />

      {/* pb clears the fixed bottom deck + safe-area on mobile */}
      <div className="mx-auto max-w-2xl px-4 pb-28 pt-8 sm:px-6 md:pb-12 md:pt-10">
        <p className="font-mono text-[11px] uppercase tracking-[0.2em] text-muted-foreground sm:text-xs">
          {page.meta}
        </p>
        <h1 className="mt-3 text-balance text-2xl font-semibold tracking-tight sm:text-3xl">
          {page.title}
        </h1>
        <p className="mt-3 text-sm leading-relaxed text-muted-foreground sm:text-base">
          {page.body}
        </p>

        <div className="mt-10 space-y-3">
          {[
            { label: 'Embarcadero dawn loop', detail: '6.2 km · 48 m gain · packed dirt' },
            { label: 'Twin Peaks connector', detail: '3.8 km · 214 m gain · grade alert' },
            { label: 'Crissy Field out-and-back', detail: '4.1 km · flat · boardwalk' },
            { label: 'Marin ridge personal best', detail: '11.4 km · 1h 18m · granite' },
          ].map((row) => (
            <article
              key={row.label}
              className="rounded-2xl border border-border/60 bg-card px-5 py-4"
            >
              <h2 className="text-sm font-semibold tracking-tight text-foreground">
                {row.label}
              </h2>
              <p className="mt-1 font-mono text-[11px] text-muted-foreground sm:text-xs">
                {row.detail}
              </p>
            </article>
          ))}
        </div>
      </div>
    </div>
  )
}

API reference

NavbarBottomTabs accepts the following props.

PropTypeDefaultDescription
brandReact.ReactNode'CleverUI'
brandHrefstring'/'
links*NavbarBottomTabsLink[]3–5 destinations; icons render in the bottom deck and shrink inline on desktop
activestringhref of the current page, defaults to the first link
action{ label: string; href: string; icon?: LucideIcon }raised center button on mobile; filled primary CTA on desktop

…plus everything from React.HTMLAttributes<HTMLElement>: className, event handlers, aria attributes and the rest pass straight through.

Referenced types

Typestsx
export interface NavbarBottomTabsLink {
  label: string
  href: string
  icon: LucideIcon
}

Frequently asked questions

How do I install the Bottom Tabs Navbar component?

Register the @cleverui registry in your components.json ("@cleverui": "https://cleverops.com.au/r/{name}.json"), then run `npx shadcn@latest add @cleverui/navbar-bottom-tabs`. The shadcn CLI copies the source into your project, you own the code from that point. You can also copy the source directly from this page.

What dependencies does Bottom Tabs Navbar require?

Bottom Tabs Navbar uses motion and lucide-react on top of React and Tailwind CSS. You don't need to install them manually, the shadcn CLI resolves and installs npm dependencies automatically when you add the component.

Can I theme Bottom Tabs Navbar to match my brand?

Yes. The component is styled entirely with Tailwind utilities over standard design tokens (primary, background, muted, border), so it inherits your existing shadcn/ui theme automatically. Change your CSS variables and the component follows, no source edits needed for palette, radius, or fonts.

Want this built for you?

CleverUI is built by the Clever Ops web team. If you'd rather ship a hand-coded, fast, custom website than assemble one, we build them for Australian businesses every week.

Explore web development services