Navigation Bar
import { NavigationBar } from '@hanzo/ui'
Simple
A logo on the left, links on the right.
export function Simple() {return (<NavigationBar logo="Acme" items={[ { label: "Docs", href: "/docs" }, { label: "Pricing", href: "/pricing" }, { label: "Blog", href: "/blog" }, ]} />)}
Centered logo
One set of links on each side of a logo in the middle.
export function CenteredLogo() {return (<NavigationBar variant="centered" logo="Acme" leftItems={[ { label: "Shop", href: "/shop" }, { label: "New", href: "/new" }, ]} rightItems={[ { label: "Cart", href: "/cart" }, { label: "Account", href: "/account" }, ]} />)}
Breadcrumb
An ordered trail with the current page called out and not linked.
export function Breadcrumb() {return (<NavigationBar variant="breadcrumb" items={[ { label: "Home", href: "/" }, { label: "Settings", href: "/settings" }, { label: "Profile" }, ]} />)}
Model switcher
A dropdown trigger showing the current pick; choosing another fires onValueChange.
export function ModelSwitcher() {const [model, setModel] = useState("gpt-4")return (<YStack gap="$2"><NavigationBar variant="switcher" value={model} onValueChange={setModel} options={[ { id: "gpt-4", label: "GPT-4", description: "OpenAI" }, { id: "claude", label: "Claude", description: "Anthropic" }, { id: "zen", label: "Zen", description: "Hanzo" }, ]} /></YStack>)}
Types
export type NavigationBarLink = {label: stringhref?: stringicon?: ReactNode}
export type NavigationBarPerson = {name: stringavatar?: string}
export type NavigationBarOption = {id: stringlabel: stringdescription?: stringicon?: ReactNode}
export type NavigationBarVariant =| 'simple'| 'centered'| 'breadcrumb'| 'icon'| 'dashboard'| 'ecommerce'| 'collaboration'| 'communication'| 'switcher'
export type NavigationBarProps = {variant?: NavigationBarVariantlogo?: ReactNode/** Links for `simple`, `icon`, `ecommerce` (as categories) and `breadcrumb` (as the trail). */items?: NavigationBarLink[]/** `centered` only — links either side of the logo. */leftItems?: NavigationBarLink[]rightItems?: NavigationBarLink[]/** `dashboard` / `collaboration`. */title?: string/** `dashboard`. */user?: NavigationBarPerson/** `collaboration`. */collaborators?: NavigationBarPerson[]/** `ecommerce`. */cartCount?: number/** `communication`. */contactName?: string/** `switcher`. */options?: NavigationBarOption[]value?: stringonValueChange?: (id: string) => voidonSearch?: () => voidonNotifications?: () => voidonCall?: () => voidonVideo?: () => voidonMessage?: () => voidchildren?: ReactNode}
Exports
NavigationBartype NavigationBarLinktype NavigationBarOptiontype NavigationBarPersontype NavigationBarPropstype NavigationBarVariant