Skip to main content
Solved

Animated button that changes to another variant & opens a new frame on click

  • January 10, 2022
  • 5 replies
  • 9362 views

Duncan_Bell

Hi everyone!

I want one of my smart animated components, a button, to do two things when it is clicked.

  1. Change to a variant - so it goes from the unselected to the selected state.
  2. Trigger the opening of the next overlay

This is so that the user sees the button that they click change briefly before the next overlay opens.

I can do both of these in isolation and I can make it work in a dumber way with an interim screen, but I can’t get it to work in one step. Any advice very welcome!

Thanks

Duncan

Best answer by tank666

Hi @Duncan_Bell, I made an example of a prototype which you can see on the links below.

Design file:

Figma – 12 Jan 22

Is this what you expected?

View original
This topic has been closed for replies.

5 replies

ntfromchicago

I’ve been experimenting with this the past few days, and creating an encapsulated variant with a delayed navigation trigger doesn’t seem possible. I can do it without using variants, but that, like you said, feels like the “dumber” way.

I’d love to see if anyone else here has pulled off this use case within a variant, and make it reusable. (The technique I tried was overriding the instance of a variant state for a navigation, and using some smart animation hackiness to force a delay.)


tank666
  • 4873 replies
  • Answer
  • January 12, 2022

Hi @Duncan_Bell, I made an example of a prototype which you can see on the links below.

Design file:

Figma – 12 Jan 22

Is this what you expected?


Duncan_Bell
  • Author
  • 2 replies
  • January 12, 2022

tank666 - I think you’ve nailed this, thank you so much. I will try and replicate this with my design system this afternoon. 😃 👏


Duncan_Bell
  • Author
  • 2 replies
  • January 12, 2022

@tank666 I just wanted to say thanks again. I got this working with my own components today. Really nice solution that will save me a load of time.

💪👏


  • 0 replies
  • February 11, 2022

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings