DEV Community

Discussion on: How to design a simple and beautiful Navbar using NextJS and TailwindCSS

Collapse
 
tiaxter profile image
tiaxter • Edited

Hi, I tried this code. And it works nicely. To obtain a menu opening transition I added useRef hook, and so when active set the menu content height equal to refElement.current.scrollHeight + 'px'.

Here my example:
dev-to-uploads.s3.amazonaws.com/up...

Collapse
 
kirtirajsinh profile image
kirtirajsinh

Can you share the useRef function. it'll be helpful