Replies: 2 comments 7 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
![image](https://private-user-images.githubusercontent.com/108960717/351484034-661b04ee-f393-4e4b-a55d-9c977d6fe6fe.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk5NDU0MzUsIm5iZiI6MTczOTk0NTEzNSwicGF0aCI6Ii8xMDg5NjA3MTcvMzUxNDg0MDM0LTY2MWIwNGVlLWYzOTMtNGU0Yi1hNTVkLTljOTc3ZDZmZTZmZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxOVQwNjA1MzVaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kNWE3ODU4OWEzNTc4MzU2MDVjMGU3OTAzZjczMDFiNzBhYTNlYjQxNWY0YmZjMDZkMjEwYjIyZDMxYzZiMTNlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.6ajECTUyvsU9J3YMNISjT_Mgl3qaalsjNsrU_b_kEQY)
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