Skip to main content

Hello everyone,


After investing numerous hours, I successfully designed an intricate expand-and-collapse navigation system using variables and components from a library. I incorporated rules to establish transitions between these components, as demonstrated in @miggi presentation at the Figma event.


Here are the steps I followed to create this dynamic navigation:




  1. Begin by crafting a component with multiple states.




  2. Utilize smart animation to transition smoothly between these states.




3)Create a text variable to represent each state within the component.




  1. Establish an additional text variable designed to toggle between all available states; consider naming it ā€˜currentState.ā€™




  2. To work some magic, simply set each state variableā€™s value to match the name of the corresponding component state. Figma will automatically recognize these associations.

    Assign the ā€˜currentStateā€™ variable to the element on the frame responsible for toggling between different states.




With these steps, youā€™re all set! However, thereā€™s a small spoiler alert: I encountered an issue when attempting to convert this beautiful navigation into a component. A vexing message popped up: ā€œRemoved variant bindings from nested instance.ā€ This problem nullifies the use of variables in the prototype, leaving us with the frustrating Pasta View.

So, thatā€™s the challenge Iā€™m currently facing. If anyone has any insights or solutions to resolve this issue, your input would be greatly appreciated. Letā€™s crack this conundrum together!




nonacomponent


component

Nice setup!


Yes, sadly some variables are not (currently) available for nested instances ā€” found that on a Note on the Figma Learn site.


So in that case you canā€™t assign a string variable, but I have found you can access boolean variables: See example file



Thatā€™s right Nate, for that reason, any of the examples in the Figma presentation include, Animation + Variables inside of the components. If this doesnā€™t change we only have plain prototypes without transitions.


About the file shared, yes you can add Boolean variables but you cannot add transitions in the prototype like when they are used string variables and then creating a component. The problem is to use String instead of a transition action directly in the Variables.


Reply