Arcana UI
Components

Navbar

Top navigation bar with logo, navigation links, and action slot. Responsive with mobile hamburger menu.

Import

import { Navbar, NavbarBrand, NavbarNav, NavbarItem, NavbarActions } from '@arcana-ui/core'

Usage

<Navbar>
  <NavbarBrand href="/">
    <img src="/logo.svg" alt="Acme" height={28} />
  </NavbarBrand>
  <NavbarNav>
    <NavbarItem href="/" active>Home</NavbarItem>
    <NavbarItem href="/pricing">Pricing</NavbarItem>
    <NavbarItem href="/docs">Docs</NavbarItem>
    <NavbarItem href="/blog">Blog</NavbarItem>
  </NavbarNav>
  <NavbarActions>
    <Button variant="ghost" size="sm">Sign in</Button>
    <Button size="sm">Get started</Button>
  </NavbarActions>
</Navbar>
PropTypeDefaultDescription
stickybooleanfalsePosition fixed at top of page
borderedbooleantrueShow bottom border
childrenReact.ReactNodeNavbarBrand, NavbarNav, NavbarActions
classNamestringAdditional CSS classes
PropTypeDefaultDescription
hrefstring'/'Brand link URL
childrenReact.ReactNodeLogo or brand text
PropTypeDefaultDescription
hrefstringLink URL
activebooleanfalseMark as current page
disabledbooleanfalsePrevent interaction
childrenReact.ReactNodeLink label
<Navbar sticky>
  ...
</Navbar>
 
<main style={{ paddingTop: '64px' }}>
  {/* Account for navbar height */}
</main>

With avatar and dropdown

<NavbarActions>
  <Avatar name="Jane Smith" size="sm" />
</NavbarActions>

Mobile behaviour

The Navbar includes a built-in hamburger menu button on small screens. The navigation collapses into a slide-down panel below 768px.

Accessibility

  • <nav> element with aria-label="Main navigation"
  • Active item has aria-current="page"
  • Mobile toggle has aria-expanded and aria-controls
  • Keyboard navigable with Tab and Enter
  • Button — action buttons in NavbarActions
  • Avatar — user avatar in nav

On this page