Skip to content

How do I get a bottom border on the selected NavigationMenuItem? #2883

Answered by pablotanner
nareshbhatia asked this question in Q&A
Discussion options

You must be logged in to vote

I got the bottom border to work by adding the border to the NavigationMenuTriggers and hiding/showing their color depending on whether the NavigationMenuItem is open or not.
Here's the code, let me know if it works for you!

        <NavigationMenu>
                <NavigationMenuList>
                    <NavigationMenuItem>
                        <NavigationMenuTrigger
                            className="border-b-2 border-b-transparent rounded-b-none data-[state='open']:border-black"
                        >
                            First
                        </NavigationMenuTrigger>
                        <NavigationMenuContent>
                            <div className="w-…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@pablotanner
Comment options

Comment options

You must be logged in to vote
2 replies
@nareshbhatia
Comment options

@pablotanner
Comment options

Answer selected by nareshbhatia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants