Skip to main content
June 22, 2023
Solved

Transitions for when setting a new variable?

  • June 22, 2023
  • 11 replies
  • 3052 views

Ive been playing around with using variables + components. You can change Figma component variants using a string variable (which is great!) but everything is instant. There doesn’t seem to be a way to define any sort of transition between variants. This is also true for number, color and boolean variables. When a variable is set it’s always an instant change.

Is there a way to achieve this?

This topic has been closed for replies.
Best answer by mfelix

Hey @Chris_Keith1,

While it won’t be possible to set up a transition in your design file when switching between variables, you’ll have the possibility to build a prototype to do this, with smart animate or any other animation.

Animating the design file itself would use more memory and would tend to lower the overall design experience in most cases.

11 replies

maskar
New Member
February 26, 2025

@Chris_Keith1 it is actually possible. It just seems to be very difficult to find the info/guide on this. 

You can achive triggering an animation for one instance, based on a change in another. 

First, you have to make a binding using a string variable:

  1. Create a String Variable
  2. Go to Component A (the controler), and Component B (the controled) and rename the variants to match to match each other. So if Button Component Variant 1 needs to show Image Component variant 1, then these should have the same name.
  3. Then when you create your Instance of Component A you go to the property field and link it to your String Variable varable. You do the same for your Instance of component B you want to change with the Instance of Component A.

This will make sure the two components are bound and influences each other. But it does not animate yet. 

Second, you add interactions to Component B:

  1. When items are bound, the bound respects the animations of the controlled Instance (Instance of Component B). 
  2. So, you simply “just” add interactions with animations between your Component B variants. 
    1. You can use after delay interaction (1ms) if you dont want Component B to be a reverse controller.
    2. Or, you can add a on click interaction, so clikiing Component B also will control Component A. In that way you can use both components to control eachother, if that is desirable. 

Now triggering animations between two seperate components should work!

Good Luck!