Navigation
Navbar
Compound component: `Navbar`, `Navbar.Brand`, `Navbar.Links`, `Navbar.Link`, `Navbar.Actions`, `Navbar.Toggle`.
Import
import { Navbar, NavbarActions, NavbarBrand, NavbarLink, NavbarLinks, NavbarToggle } from '@the_viveksingh/vivek-ui'A site header
NavbarToggle handles the mobile menu, including aria-expanded and aria-controls. NavbarLink takes asChild, so a Next.js Link keeps client-side routing.
<Navbar bordered container="lg">
<NavbarBrand href="/">VivekUI</NavbarBrand>
<NavbarToggle />
<NavbarLinks>
<NavbarLink asChild active>
<Link href="/docs">Docs</Link>
</NavbarLink>
<NavbarLink asChild>
<Link href="/docs/components">Components</Link>
</NavbarLink>
</NavbarLinks>
<NavbarActions>
<Button size="sm">Install</Button>
</NavbarActions>
</Navbar>Sticky
<Navbar sticky bordered container="lg">
{/* same parts */}
</Navbar>Props
Generated from the package's own type declarations, so this table cannot drift from the code.
| Prop | Type | Default | Description |
|---|---|---|---|
sticky | boolean | — | Pin to the top of the scroll container. Default `false`. |
bordered | boolean | — | Hairline rule along the bottom edge. Default `true`. |
size | 'sm' | 'md' | 'lg' | — | Bar height. Default `md`. |
container | ContainerProps['size'] | — | Max width of the inner `Container`. Default `lg`. |
open | boolean | — | Controlled state of the collapsed mobile menu. |
defaultOpen | boolean | — | Initial state of the collapsed mobile menu while uncontrolled. Default `false`. |
onOpenChange | (open: boolean) => void | — | — |
Every remaining prop is spread onto the root element, so all standard HTML and ARIA attributes work. className and style are merged with the library's own, never replaced, and the ref forwards to the root DOM node.
Exports
NavbarNavbarActionsNavbarBrandNavbarLinkNavbarLinksNavbarToggleRendering
Navbar declares 'use client' because it needs state, effects or event handlers. Importing it into a Server Component creates a client boundary at this component — everything above it stays on the server.