romboHQ / tailwindcss-motion

tailwindcss-motion is a Tailwind CSS Plugin made at RomboHQ. It’s a simple, yet powerful, animation library with a simple syntax.
https://rombo.co/tailwind/
MIT License
1.39k stars 18 forks source link

Event #13

Open maximebodereauseelab opened 1 week ago

maximebodereauseelab commented 1 week ago

Can we "activate" the animation on click event ?

leonardobetti commented 1 week ago

same question, cant make it work when I click just hover or page refresh

xenvi commented 1 week ago

this can be done by creating a state variable and defining the css animation class when that variable meets a condition (ex: set state to true on click, play animation, settimeout state back to false). unsure if there are plans to make an easier handler but this works for now