HextaUI

Navigation menu: Right to left

Content slides follow the direction you move, which flips in right-to-left layouts.

import {
  NavigationMenu,
  NavigationMenuContent,
  NavigationMenuItem,
  NavigationMenuLink,
  NavigationMenuList,
  NavigationMenuTrigger,
} from "@/components/ui/navigation-menu"

const menus = [
  { label: "المنتجات", links: ["المكونات", "القوالب", "السمات"] },
  { label: "الموارد", links: ["التوثيق", "الدعم"] },
]

export function NavigationMenuRtl() {
  return (
    <div dir="rtl" className="w-full max-w-md rounded-xl border px-2 py-1.5">
      <NavigationMenu variant="panel" aria-label="الرئيسية">
        <NavigationMenuList>
          {menus.map((menu) => (
            <NavigationMenuItem key={menu.label}>
              <NavigationMenuTrigger>{menu.label}</NavigationMenuTrigger>
              <NavigationMenuContent>
                <ul className="grid grid-cols-2 gap-1">
                  {menu.links.map((link) => (
                    <li key={link}>
                      <NavigationMenuLink href="#">{link}</NavigationMenuLink>
                    </li>
                  ))}
                </ul>
              </NavigationMenuContent>
            </NavigationMenuItem>
          ))}
        </NavigationMenuList>
      </NavigationMenu>
    </div>
  )
}

This adds the example as components/examples/navigation-menu/rtl.tsx, together with the Navigation menu component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/navigation-menu-rtl.json

To add only the component, follow the Navigation menu installation.

Props in this example

The Navigation menu props this example sets, from the API reference.

PropTypeDefault
variantdropdown opens under each trigger. panel opens one full-width card under the bar that stays put while content slides.
"dropdown" | "panel""dropdown"

Every prop is in the Navigation menu API reference.

See them all, with keyboard support and accessibility notes, on the Navigation menu page.