Tuimorphic

Navigation

Top-level navigation bar with logo, nav items, and action elements.

Import

import { Navigation } from 'tuimorphic';

Basic Usage

<Navigation
  logo={<span>ACME</span>}
  items={[
    { label: 'Home', href: '/', isActive: true },
    { label: 'About', href: '/about' },
    { label: 'Contact', href: '/contact' },
  ]}
/>

Props

PropTypeDefaultDescription
logoReact.ReactNode-Logo or brand element displayed on the left
itemsNavItem[][]Navigation items displayed center-left
actionsReact.ReactNode-Action elements (search, user menu, etc.) displayed on the right
showBorderbooleantrueWhether to show bottom border separator
classNamestring-Additional CSS class names
PropTypeDescription
labelstringDisplay label for the navigation item
hrefstringURL for anchor-based navigation
onClick() => voidClick handler for programmatic navigation
isActivebooleanWhether this item represents the current page

Variants

Basic

<Navigation
  logo={<span>ACME</span>}
  items={[
    { label: 'Home', href: '/', isActive: true },
    { label: 'About', href: '/about' },
    { label: 'Contact', href: '/contact' },
  ]}
/>

With Actions

<Navigation
  logo={<span>APP</span>}
  items={[
    { label: 'Dashboard', href: '/dashboard', isActive: true },
    { label: 'Settings', href: '/settings' },
  ]}
  actions={
    <>
      <Button variant="secondary">Login</Button>
      <Button variant="primary">Sign Up</Button>
    </>
  }
/>

With Click Handlers

<Navigation
  logo={<Logo />}
  items={[
    { label: 'Home', onClick: () => navigate('/'), isActive: true },
    { label: 'Products', onClick: () => navigate('/products') },
  ]}
/>

Without Border

<Navigation
  logo={<span>BRAND</span>}
  items={navItems}
  showBorder={false}
/>

On this page