Component

Navbar

A sticky header with navigation links, logo, and action slots. Responsive with links hidden on mobile. Uses the headless @refraction-ui/navbar core.

Examples

Navbar with links, active state, logo, and action button.

Installation

$pnpm add @refraction-ui/react-navbar

Usage

tsx
import { Navbar } from '@refraction-ui/react-navbar'

export function MyComponent() {
  return (
    <Navbar
      links={[
        { label: 'Home', href: '/' },
        { label: 'Docs', href: '/docs' },
      ]}
      currentPath="/"
      logo={<span>MyApp</span>}
      actions={<button>Sign In</button>}
    />
  )
}

Props

PropTypeDefaultDescription
linksNavLink[]--Array of { label, href } navigation links.
currentPathstring--Current pathname for active link highlighting.
variantNavbarVariant--Visual variant of the navbar.
logoReactNode--Logo or brand element (left side).
actionsReactNode--Action buttons (right side).
classNamestring--Additional CSS classes.