Skip to main content
J.D_Posey
June 22, 2023
Question

Variables + Smart Animate?

  • June 22, 2023
  • 27 replies
  • 10932 views

Not seeing a way to have variable bool states allow for smart animations in the same way changing variant states allows for it (i.e. if you made a switch that flipped using 2 variants, it’s easy to have them smart animate to each other… but not possible with variables, as variable state changes don’t seem to have controls for animation)

This topic has been closed for replies.

27 replies

Michael_Kwasiuk
June 26, 2023

Indeed… this makes the new variable boolean states unusable in prototyping. Since prototypes are ment to represent the production product closely as possible.

July 12, 2023

I have been looking for the same thing since the variable update and very surprised that it wasn’t done from the start as it seemed to me the natural way of using them. I also can’t find any info on if it is coming up at any point.

Marshall1
New Member
July 13, 2023

+1

I need the variable changes to be able to use the same smart animate that the other pieces can use

Bez1
New Participant
July 25, 2023
August 30, 2023

It’s convoluted… But I found a work-around. Variables are set up to trigger any “change to” animations that are set up at the component level.

ie. if you create a toggle component with two variants that smart animate to one other on click, then changing the variant state of that component with variables would also trigger that animation.

The trouble is that sometimes you want variables to be the only thing to trigger that state change, and not any other prototyping interaction options like “on hover” or “on click”. If that’s the case, you can kind of hack it by using the “key/gamepad” interaction, but not assigning any key. You can then set up your animation settings, and when the variable triggers the state change from one variant to another, it will pull those “key/gamepad” animation settings without anything else being able to trigger it.

Melissa_A_Casole
September 7, 2023

@J.D_Posey im not sure if you’ve already found the solution to this. But during the Figma Expo they do show how to retain the smart animate function while using variables. The trick is to create a variable that holds all the component states.

  1. create a component with multiple states
  2. smart animate between the states
  3. create a text variables that ‘holds’ each state (i usually just name the variable the name of the component state)
  4. create another text variable that will toggle b/t all the other states (name it like ‘currentState’)
  5. Here’s the. magic: for each state variable - for the value, type in the name of that component state. Figma will automatically pick up that state.
  6. Assign the currentState variable to the element on the frame that will toggle b/t states.
  7. All done!
Cat_de_Leon
September 19, 2023

I’m unable to recreate this using your method. Does this still work for you?

JustJest
New Member
September 20, 2023

How about with a component with one variant and you’re just toggling the layer visibility on and off (ie for a dropdown menu)?

Melissa_A_Casole
September 20, 2023

Here’s a loom i created showing how to do it

Loom
Cat_de_Leon
September 20, 2023

That was really super helpful, thank you so much! Can you please take a quick screenshot or show what the prototyping settings looks like for your component/variants?