Skip to contentKino
Skip to Content

Navigation menu

A site header's menu whose triggers share one panel that travels and resizes as you move along.

npx shadcn add https://kinoui.com/r/navigation-menu.json
Share on

Examples

Kino

Project planning

Plan the work, then watch it ship.

Boards, cycles and an inbox for every team, on one bill.

Default

The panel grows out of its trigger, then travels and resizes as you move along, with new content sliding in from the side you moved towards.

Slide distance

Set how far new content travels with --navigation-menu-slide, on a panel or on <body>.

Installation

npx shadcn@latest add https://kinoui.com/r/navigation-menu.json
Files
lib/refs.tslib/reduce-motion.tslib/scroll.tslib/popup.tslib/glide.tsxlib/resize.tslib/run-progress.tslib/highlight.tscomponents/kino/navigation-menu.tsx
Packages
@base-ui/react

New to Kino? Installation covers what your project needs first and the @kino namespace.

API reference

PropTypeDefaultDescription
valueanyNoneThe open item, when you hold the state; null when closed.
onValueChange(value, details) => voidNoneCalled when an item opens or the menu closes.
closeDelaynumber150How long the panel waits before it closes, in ms: long enough to reach the next trigger, so it switches instead.
PropTypeDefaultDescription
classNamestringNoneGoes to the panel inside: w-72 with an 8px margin for the highlight, unless you set a width or a layout.
PropTypeDefaultDescription
activebooleanNoneMarks the link to the page you are on, read out as the current page. In the list it keeps a tint, which travels to the next link marked active.
closeOnClickbooleantrue in a panelWhether following it closes the menu.

Data attributes

AttributeOnDescription
data-glidedNavigationMenuTrigger, NavigationMenuLinkOn the item the highlight is on, so what is inside it can change with it, as the icons do.

CSS variables

VariableSet it onDefaultDescription
--navigation-menu-slideNavigationMenuContent, or <body>28pxHow far new content slides in from the side the pointer moved towards. The old content leaves the other way.

Accessibility

  • The menu is a nav landmark: give it an aria-label when the page has more than one.
  • Each trigger is a button with aria-expanded; links are links, so the menu reads as site navigation, not an app menu.
  • Arrow keys move between the triggers and between the links of a panel; Tab goes from a trigger into its panel and on.
  • Escape closes the panel and puts focus back on its trigger.
  • On a touch screen, a tap opens a panel and a second tap closes it.
  • When the system asks for less motion, the panel and the highlights only fade.