ValyroUI Русская версия

Navbar

Top navigation bar. Free, MIT · Navigation and layout › Structure

Below 768px of its own width (container query) the links collapse into a menu button that opens them in a sheet under the bar.

Installation

npx valyro-cli@latest add navbar
npx shadcn@latest add https://valyro.xyz/r/navbar.json
npm install valyro-ui

import 'valyro-ui/styles.css';
import { Navbar } from 'valyro-ui';

Props

PropTypeDefault
brandReactNodeLogo / product name on the left.
linksNavbarLink[][]Navigation links in the center; each renders as an anchor with href, else a button.
actionsReactNodeRight-side slot: buttons, avatar, search. Stays visible on narrow widths.
stickybooleanfalseStick to the top of the nearest scroll container.
labelstring'Main'Accessible name of the links navigation.
menuLabelstring'Menu'Accessible name of the button that opens the links on narrow widths.
menuOpenbooleanWhether the links sheet is open (narrow widths only; controlled).
defaultMenuOpenbooleanfalseInitial state of the links sheet when uncontrolled. Opening it this way does not move focus into it.
onMenuOpenChange(open: boolean) => voidCalled when the links sheet opens or closes.

Related components

Previous: App Shell · Next: Sidebar · All Navigation and layout