A navigation bar whose items open wide panels of grouped links. One panel resizes between items, and a safe triangle keeps it steady on a diagonal path.
pnpm dlx shadcn@latest add @latheui/mega-menuPart of Lathe Pro. Set up your project once with your license key: npx latheui init --key <key>. See Lathe Pro.
Mega Menu is part of Lathe Pro
The preview is live and free to try. The source, the install and every assembly come with Pro: $79 once, with lifetime updates.
Depends on
Also accepts Radix NavigationMenu root props, such as delayDuration. An item's value is its label, so value="Product" opens that panel.
| Prop | Type | Default | Description |
|---|---|---|---|
| items* (required) | MegaMenuItem[] | — | Top-level items, in order. |
| label | string | "Main" | Accessible name of the navigation landmark. |
| renderLink | (link: { href, className, children }) => ReactElement | an <a> | Renders every link. Return your router's link here. |
| safeTriangle | boolean | true | While the pointer moves from an open item toward its panel, other items it crosses do not take over and the gap does not close the panel. |
| safeTriangleTimeout | number | 300 | Milliseconds the pointer may rest on its way before the item under it takes over. |
| showSafeTriangle | boolean | false | Draws the triangle while it is active. For tuning and demos. |
| Prop | Type | Default | Description |
|---|---|---|---|
| label* (required) | string | — | Text in the bar. |
| href | string | — | Makes the item a plain link. Used when there are no sections. |
| sections | MegaMenuSection[] | — | Columns of the panel: { heading?, links }. |
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | — | Link text. |
| href* (required) | string | — | Destination. |
| description | string | — | A line under the title. Sections without descriptions are drawn as a compact list. |
| icon | ReactNode | — | Shown before the title. |
import Link from "next/link"
<MegaMenu
items={items}
renderLink={({ href, className, children }) => (
<Link href={href} className={className}>
{children}
</Link>
)}
/>