Replies: 2 comments 4 replies
-
The building blocks for nested menu should look something like this: <NavigationMenu className="flex flex-col top-0 place-content-start content-start">
<NavigationMenuList className="relative">
<NavigationMenuItem>
<NavigationMenuTrigger>Getting started</NavigationMenuTrigger>
<NavigationMenuContent>
<ul className="grid gap-3 p-6 md:w-[400px] lg:w-[500px] lg:grid-cols-[.75fr_1fr]">
<li className="row-span-3">
<NavigationMenuLink asChild>
{/* This is the nested menu */}
<NavigationMenu className="flex flex-col top-0 place-content-start content-start">
<NavigationMenuList className="relative">
<NavigationMenuItem>
<NavigationMenuTrigger>shadcn</NavigationMenuTrigger>
<NavigationMenuContent>
<div> hi</div>
</NavigationMenuContent>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu>
</NavigationMenuLink>
</li>
<ListItem href="/docs" title="Introduction">
Re-usable components built using Radix UI and Tailwind CSS.
</ListItem>
<ListItem href="/docs/installation" title="Installation">
How to install dependencies and structure your app.
</ListItem>
<ListItem href="/docs/primitives/typography" title="Typography">
Styles for headings, paragraphs, lists...etc
</ListItem>
</ul>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<NavigationMenuTrigger>Components</NavigationMenuTrigger>
<NavigationMenuContent>
<div> hi</div>
</NavigationMenuContent>
</NavigationMenuItem>
<NavigationMenuItem>
<Link href="/docs" legacyBehavior passHref>
<NavigationMenuLink className={navigationMenuTriggerStyle()}>
Documentation
</NavigationMenuLink>
</Link>
</NavigationMenuItem>
</NavigationMenuList>
</NavigationMenu> manipulated the DOCS to fulfill nested navigation menu, obviously styling is neccessery but the required content is shown, tell me how it works out and if u need further help :) |
Beta Was this translation helpful? Give feedback.
-
Hi, have you find a way to create this deep nested navigation menu items? i tried @itaim18 suggestion but it doesn't work if the nest is too deep, the nav content immediately disspear as soon as i hover the trigger. i ended up using dropdown menu, i customized it so it can open on hover but it's still buggy |
Beta Was this translation helpful? Give feedback.
-
My goal is to have the shadcn Navigation menu display categories vertically and then when the user hovers on those categories they display subcategories horizontally
Here's a visual example. Whenever I try to nest one menu into another the second menu does not display it's content.
Beta Was this translation helpful? Give feedback.
All reactions