Close navbar on item click on mobile screen #1789
Replies: 1 comment
-
Closing: My solution was to use Navbar event (docs). Then just use the onClick somewhere in the const [isMenuOpen, setIsMenuOpen] = useState(false);
<Navbar
isMenuOpen={isMenuOpen}
onMenuOpenChange={setIsMenuOpen}
>
<NavbarContent className="sm:hidden" justify="start">
<NavbarMenuToggle aria-label={isMenuOpen ? "Close menu" : "Open menu"} />
</NavbarContent>
...
</Navbar> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to close the navbar whenever I click an item. How to do this?
Beta Was this translation helpful? Give feedback.
All reactions