hey there,
I can’t figure out how to animate this Button, I want to animate it like this
Animating Button Hover?
Best answer by tank666
I suggest that you change the structure of the component to remove the boolean operation from it, because smart animation may not behave as intended.
This is what the component should look like:
Button // (auto layout frame)
Overlay // (an absolutely positioned frame with the Clip content property checked)
Text // (with the component's text property applied)
Text // (with the component's text property applied)
At the Button level, add the background color that should be on hover. Also add a fill to the text that will be visible on hover.
At the Overlay level, add a color that overlays the background (i.e. visible on the button at rest). Add a fill to the text inside the overlay that will be visible at rest.
Now you can add a variant to the component set that will only need to change the height of the Overlay layer. Add an interaction and set your desired animation.
You can see an example file here:
Figma – 31 Mar 23Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.