Prototyping functions like in javascript to manage a complex prototype

I wish Figma will create prototyping functions so i could create a function template and send him the request variables, just like in javascript, a function that holds set variables, conditions and more.

That will save a lot of prototyping time and the interactions will be managed better for changes.

Currently, if you have a lot of variable interactions then it’s a hard to manage repeated interactions with small changes and adds or even keeping track of the prototype logic.

I wish it will look like this:

  1. Creating the variables
  2. Creating the functions
  3. Applying functions to the prototype.
  4. Managing logical functions for changes

Check out my screenshots to understand my pain of managing all of this.

Hey Shaul, thank you for raising this feature request with us! We’ll pass your feedback along to the teams.

1 Like

Wish variables have more features.

My fav one is:

  • Variables scoped to component instance

Ability to do else if would also be extremely helpful and cut down on funky logic.


I wish I could trigger the actions already assigned to a component. But creating functions is even a lot better.

Another one is to be able to refer to instance with “this” from within a component to not affect all instances. Would allow to do easy hover on components that have on click actions.

1 Like


I be like, mate, who would you do that? What kind of design idea requires such effort express?

Any prototype that you would like to test on real users with real actions.

Any prototype that you would like to change one small expression or logic.

Any prototype that your interactions are repeated.

Prototype Maintenance is very important for any designer and company. Currently you cant maintain variables and remember all your interactions.

I did create a way to place all my interactions in order so the logic would be readable and easier for change but it’s a walk-around.

1 Like

Got that. In my view, this type of complexity requires different tools. Just saying. The interactions you put in place are very complex, thus I recon very fragile. Not sure if Figma is the right tool.

I don’t think we need another tool when Figma allows that much of complex interactions, so i believe that Figma does recommend using it and it’s amazing to use and supports most usecases in UI logic.

The Figma dev team did a great job of taking basic javascript options and producing amazing results. They did most of the work needed for top noch prototyping tool that is still simple to use.
Only missing logic maintenance = functions.

In a small usecase when you have couple of set variables and you need to repeat this exact logic in a different frame. After sometime, it’s hard to remember whats going on and you don’t have any visual indicator or anything to help you understand. function represents a name for the interaction so you can understand what does it do.

In a big usecase with many variables sets in many places, you can’t remember what you did and if you need to change the logic then it’s a big problem, similar to what a developer feels when he needs to make a change in someones code.

Figma interactions UI looks like code, acts like code then it should adopt the code approach- any developer will say, don’t write the same line of code twice.

Thank god we have Figma forum and we can share ideas.
@Pavel_Kiselev feel free to suggest better Figma improvements to improve the way we manage variables and lets improve Figma together.