Skip to content

Navigation Menu

Get Ritla UI

Website navigation with dropdown panels: a few destinations each with an icon and one short line, and at most one featured card.

Ritla scan of this preview: 41 of 41 checks3 breakpointsScanned

Open in Figma

Preview

Mirrored is the same English content laid out right to left: it separates a mirroring bug from a translation one.

PreviewCode
EnglishMirroredArabic
LTR →

Installation

  1. Add the component

    npx ritla add navigation-menu

    Also works with shadcn: npx shadcn@latest add @ritla/navigation-menu

  2. Dependencies it brings

    @base-ui/react@phosphor-icons/react

  3. Or copy by hand

    Installing by hand copies the component's source into your project. The source comes with a Ritla UI license, so the CLI is the short way to the same files.

Usage

navigation-menu.tsx
import {  NavigationMenu,  NavigationMenuContent,  NavigationMenuItem,  NavigationMenuLink,  NavigationMenuLinks,  NavigationMenuList,  NavigationMenuPanelLink,  NavigationMenuTrigger,} from "@/components/ui/navigation-menu";<NavigationMenu aria-label="Main">  <NavigationMenuList>    <NavigationMenuItem>      <NavigationMenuTrigger>Products</NavigationMenuTrigger>      <NavigationMenuContent>        <NavigationMenuLinks>          <NavigationMenuPanelLink href="/payments" icon={CreditCardIcon} title="Payments" description="Accept cards, Apple Pay and CliQ." />        </NavigationMenuLinks>      </NavigationMenuContent>    </NavigationMenuItem>    <NavigationMenuItem>      <NavigationMenuLink href="/pricing">Pricing</NavigationMenuLink>    </NavigationMenuItem>  </NavigationMenuList></NavigationMenu>

Examples

One column, and the current page

columns={1} for short panels, with no featured card. The plain link for the current page takes active (aria-current="page").

EnglishMirroredArabic
LTR →

On a dark surface

tone="inverse" on the root: white labels and a translucent white hover, for a row on a dark band, a photo or the brand color. The panel stays light. The panel also ends with a NavigationMenuFooter and its link, one per panel.

EnglishMirroredArabic
LTR →

API reference

NavigationMenu

PropTypeDefaultDescription
aria-labelstringNoneThe navigation's name, when the page has more than one nav.
delay / closeDelaynumber50 / 50The wait before opening and closing on hover (ms).
value / onValueChangestring | nullNoneThe open panel, to control it from code.
tone"default" | "inverse""default"_Nav link's Tone, for the whole row.

NavigationMenuTrigger

PropTypeDefaultDescription
childrenReactNodeNoneFigma's Label. The caret is added for you.

NavigationMenuLink

PropTypeDefaultDescription
hrefstringNoneA plain link in the row, with no panel.
activebooleanNoneThe current page.
renderReactElementNoneYour framework's link, e.g. Next's <Link />.

NavigationMenuLinks

PropTypeDefaultDescription
columns1 | 22Link columns, 220px each.

NavigationMenuPanelLink

PropTypeDefaultDescription
iconIconComponentNoneAn icon in a brand/faint box.
titleReactNodeNoneFigma's Title: the destination.
descriptionReactNodeNoneFigma's Description: one short line.
href / renderstring / ReactElementNoneThe link.

NavigationMenuFeatured

PropTypeDefaultDescription
tagReactNodeNoneThe small tag at the top ("New").
title / descriptionReactNodeNoneTitle and description.
linkLabelReactNodeNoneThe call to action at the bottom; the whole card is the link.

NavigationMenuFooter, NavigationMenuFooterLink

PropTypeDefaultDescription
linkReactNodeNoneA NavigationMenuFooterLink at the footer's start ("All products"), with an arrow that mirrors in Arabic.
childrenReactNodeNoneThe help line at the footer's end; it may hold a link.
hrefstringNoneNavigationMenuFooterLink: the destination.

Usage guidelines

A navigation menu is a bar of links in a site header, some of which open panels. Links versus triggers, the panels, how it mirrors in Arabic, and the checks before handoff.

2. Panels

Panels align to the start edge of their trigger and never exceed the header width. On phones the same groups move into a side Sheet behind a menu button.

Do

  • Use the Header base variants for desktop and mobile.
  • Group panel links in columns of five or fewer.

Don't

  • Let a panel cover the hero.
  • Animate panels longer than 150 ms.

3. Arabic and RTL

The link order mirrors and the panels align to the inline start of their trigger. The logo stays on the inline start.

Before handoff

  • Desktop and mobile Header base placed in both directions.
  • One panel open state shown.
  • Active link marked on the current page.

Accessibility

Keyboard

Keys are written for left-to-right. In right-to-left the arrow keys swap: the one pointing toward the reading direction moves forward.

KeyAction
TabAlong the row; from an open trigger through its panel's links, then on to the next item.
EnterSpaceOn a trigger: opens or closes its panel.
ArrowRightArrowLeftAlong the row; in Arabic, ArrowLeft goes to the next.
EscCloses the panel and returns focus to its trigger.

ARIA

  • A <nav> with a list (ul) of items; each trigger has aria-expanded and aria-controls.
  • Panel links are real links, and the featured card is one link.
  • Triggers are 32px tall with a 48px hit area vertically only.
  • On phones: a menu button that opens a Drawer with the same groups in an Accordion.

Arabic and RTL notes

Mirrors

  • The first item sits on the right, and the panel starts at the row's right edge.
  • Panel links read from the right, and the featured card sits on the left.
  • In the footer the link sits on the right with its arrow pointing left, and the help line on the left.

Does not mirror

  • The trigger's caret points down and turns when open; it doesn't mirror.
  • The links' icons don't mirror.
Numerals
Numbers in descriptions follow the numerals setting (toNumerals for fixed strings).
Arabic typography
Triggers label-16 Medium (Semibold while their panel is open), link titles label-14 Semibold, descriptions label-12, the card title label-16 Semibold.
Mixed-direction text
Latin product names (Apple Pay, iOS) inside an Arabic description keep their order. The panel carries the page's direction and language into the portal.

Do

  • Set Nav position to Start or Center as in English; it mirrors on its own.
  • Check long Arabic labels at the tablet width.

Don't

  • Centre the links to dodge RTL.
  • Mirror chevrons that point down.

Checks it passes

The Ritla checks this component satisfies by construction. Used as documented, it does not bring these defects onto your page.

  • R042Clipped text: content wider than its box with overflow hidden and no ellipsis
  • R043Fixed-pixel-width container whose Arabic text exceeds the space
  • R050Arabic text falling back past the declared font family (measured, declared, or a webfont that failed to load)
  • R051letter-spacing applied to Arabic text (breaks the connected script)
  • R081flex row-reverse faking RTL instead of dir (tab order fights visual order)