YuhuanStudioYunUIDocs
Patterns

Navbar

Generic navigation using the same existing YunUI header implementation.

Use the existing YunUI navigation bar for a general website. This is the same component as the compatible /ai export, with no AI runtime dependency or new visual design. It owns the floating header, active-link behavior and mobile menu; the host supplies branding, link data, account/actions slots and routing adapters.

Import

tsx1 line
import { Navbar } from "@yuhuanowo/yunui/patterns";

Example

Use with PageLayout to reserve space below the fixed header. Full API and slot examples are on the shared Navbar page.

Props

PropTypeDefaultDescription
accountReactNode—Signed-in account control — pass an `AccountMenu`. When present it REPLACES the sign in / sign up buttons (desktop and mobile), so a reader who is already signed in sees their avatar rather than an invitation to sign in again.
actionsReactNode—Extra controls in the right-hand cluster, before the language/theme pills — a GitHub link, a search button. Desktop only, matching the rest of that cluster; put the mobile equivalent in `mobileMenuHeader`.
appName*string—Brand name shown next to the logo.
brandReactNode—Replaces the logo + wordmark block entirely. Pass a mark-only logo, a custom lockup, anything — it is still wrapped in the link to `homeHref`. Without this, a brand that is a single glyph had to be faked through `logoSrc`/`appName`, which is why YunUI's own site and YunNEWS each kept a private copy of this bar.
classNamestring—Extra classes on the `<nav>` element.
currentPathstring/Current route, used for active-link + scroll-spy.
homeHrefstring/Where the logo links to.
labelstring—Accessible name for the `<nav>` landmark. A page with more than one nav needs each one named, or a screen reader offers several identical "navigation" regions.
labels{ signIn?: string; signUp?: string; menu?: string | undefined; } | undefined—Localized auth labels.
languageSwitcherReactNode—Right-side control slots; the host injects the configured switcher.
linksNavLink[][]Center navigation links. The host builds these from branding/flags/i18n.
loginHrefstring/loginSign-in link destination.
logoSrcstring/favicon.icoLogo image src (default: /favicon.ico).
mobileMenuFooterReactNode—The bottom region of the mobile menu, under the divider. Passing this REPLACES the automatic `languageSwitcher` row there — so a host that wants the language pill alongside something else (a GitHub link, a status chip) lays that row out itself instead of getting two rows. Leave it off and the language row appears on its own, as before.
mobileMenuHeaderReactNode—Rendered at the TOP of the mobile menu, above the links.
signupHrefstring/signupSign-up link destination.
themeToggleReactNode—Defaults to YunUI's ThemeToggle.
variant"public" | "minimal"public`public` (full nav + auth) or `minimal` (no links/auth).

On this page