Menu open close animation Tailwindcss #2744
-
Hi I have a hamburger menu icon, I can make it open close with js, but how can animate for it? I read the comment but don't understand how to implement it.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You will need to wrap you component where you want to apply the animation on with the transition component from after that you can use the classes based on you're menuOpen state like so:
|
Beta Was this translation helpful? Give feedback.
-
I'm having a similar problem with a different tailwindcss/ui component and I don't find any Transition component in the headlessui package, at least not the vue version. I've looked around for help on this and can't find anything. I hope that the tailwind team will consider giving a little more help in the documentation for this. I get that implementing the JS for the components is it's own project but a little bit more of a hint on how to apply this transitions could be really helpful. |
Beta Was this translation helpful? Give feedback.
You will need to wrap you component where you want to apply the animation on with the transition component from
import { Transition } from "@headlessui/react"
You can find the repo here: https://github.com/tailwindlabs/headlessuiafter that you can use the classes based on you're menuOpen state like so: