Library/Navbar

Navbar

Responsive navigation bar with search, user profile, mobile menu, and theme toggle.

Modular Build
Interactive Preview
Initialising Operative...

Architecture

Component Architecture
Navbar/

Prop Usage

PropTypeDefaultDescription
links
NavLink[][]Array of { label, href } objects rendered as nav links.
user
NavbarUser | nullnullLogged-in user data. When provided, shows the UserProfile dropdown.
onSearch
(query: string) => voidEnables and handles the command-palette search.
onLogout
() => voidCallback for the logout action in the user dropdown.
onSwitchAccount
() => voidCallback for the switch-account action.
actions
React.ReactNodeSlot for custom right-side actions (e.g. a Login button) when no user is logged in.
showThemeToggle
booleantrueWhether to render the ThemeToggler.
logoHref
string"/"Destination of the logo link.
layoutId
stringFramer Motion layoutId for the active-link pill animation.
className
stringAdditional classes on the <nav> element.

Usage

import Navbar from '@/components/layouts/Navbar/Navbar'; <Navbar links={[ { label: 'Home', href: '/' }, { label: 'Docs', href: '/docs' }, ]} user={{ name: 'Jane', email: 'jane@example.com' }} onLogout={() => supabase.auth.signOut()} onSearch={(q) => console.log('search:', q)} showThemeToggle />