You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesi贸n a prueba de IA

Antes: $249

Currency
$209
Suscr铆bete

Termina en:

1 D铆as
17 Hrs
40 Min
16 Seg
Curso de Figma

Curso de Figma

Santiago Camargo

Santiago Camargo

Protipado 3

18/22
Resources

How to create multiple actions in Figma?

Welcome to the world of advanced prototyping in Figma! If you're already here, it's because you've mastered the basics and are ready to move up a level. In this lesson, we'll explore how to use components, variants, and variables to create multiple actions in a prototype. Get ready to take your design skills to amazing heights and experience more fluid and natural interactions.

How to set up multiple interactions in a button?

A common case when designing interfaces is wanting a single click to trigger multiple actions. Imagine you have a button that not only saves a path, but also displays a confirmation notification.

// Assuming you have a component with two variants:'saved' and 'unsaved'const botonGuardar = document.getElementById('botonGuardar');// First action: switch from 'unsaved' to 'saved'botonGuardar.addEventListener('click', () => { changeButtonState('saved'); showToast('SavedPath');});function showToast(message) { const toast = document.createElement('div'); toast.innerText = message; document.body.appendChild(toast); setTimeout((() => { toast.remove(); }, 1200); // Time for message to disappear}

In this example, the button triggers a state change and displays a Toast message, all with a single click. Note that the time for the Toast to appear can be adjusted to provide a better user experience.

How to apply variables and states to components?

Variables allow you to dynamically manage the state of prototype elements. Suppose you are working with a filter that shows or hides paths that have or don't have trees.

// Using boolean variables to change visibilitylet showTreesOnly = true;function toggleFilterTrees() { showTreesOnly = !showTreesOnly; updatePathVisibility();}function updatePathVisibility() { const paths = document.querySelectorAll('.path'); paths.forEach((path) => { if (path.classList.contains('noTrees') && !showTreesOnly) { path.style.display = 'none'; } else { path.style.display = 'block'; } } } );} }

Thus, you can manage the visibility of trails by toggling between showing all or only those with trees, improving the interactivity and usability of your application.

How to integrate states and variables for a more dynamic experience?

By merging component states with variables, you can achieve a high level of control over interactions. Consider a scenario where clicking on a filter not only changes its graphical state, but also modifies a variable that controls which elements are visible.

// Generalizing a function that changes the state and sets a variablefunction changeStateAndVariable(button, variable, value) { button.addEventListener('click', () => { variable = value; updateInterface(); });}const filterTreesBtn = document.getElementById('filterTrees');changeStateAndVariable(filterTreesBtn, showOnlyWithTrees, true);function updateInterface() { // Updates elements according to the new value of variables // Here are functions that update the visibility of paths and change the graphical state of the filter updatePathVisibility();}

This code implements complex interactions that bring realism to the interactive simulation. With each click, the prototype responds to give more veracity to the user experience, simulating the operation of a real application.

Figma becomes, in your hands, a powerful tool that transcends from static to dynamic design, making tangible any interactive idea you can imagine.

Contributions 10

Questions 1

Sort by:

Want to see more contributions, questions and answers from the community?

soy yo o hizo falta una clase de variantes?
Creo que falta explicar como hacer esa variable booleana
Estuve revisando en youtube y primero hay que tranformar los elementos en componentes con Ctrl+Alt+K (Para windows) y luego en la parte superior derecha , donde aparece el noombre del compomente hay un rombo con un mas en el centro que es "add variant" automaticamente se hace una copia del componente 1 ![](https://static.platzi.com/media/user_upload/image-355cb1bc-498f-43ec-b3df-5e27ec1ec4d9.jpg) 2 ![](https://static.platzi.com/media/user_upload/image-483ee853-b40b-471f-80aa-e7194db2db39.jpg) 3 ![](https://static.platzi.com/media/user_upload/image-a6abd238-4cc2-4f08-a827-091ece2b5130.jpg) Espero sirva de ayuda :D
Ser铆a bueno que todos los accesos rapidos que se hacen en la Mac los coloquen tambi茅n para Windows, puede ser en 'Aportes', ser铆a muy util para los team Windows 馃檶
En Windows, el comando equivalente para pegar en el mismo lugar en Figma es **Ctrl+Shift+V**
Hola a todos. Esta es la primer clase en donde me senti perdida. Les dejo el link a un video de youtube, donde hace una intro que a mi me ayudo muchisimo. Espero sea de utilidad para alguien mas. Saludos <https://www.youtube.com/watch?v=f5mo5PnnazI>
LAS VARIABLES NO ME FUNCIONA BIEN YA QUE NO TENGO EL PREMIUM :(
Despues de estar dos dias dandole vueltas, pude avanzar. Dejo los pasos que me ayudaron (en mi caso me faltaba que cada elemento sea un componenete POR SEPARADO) **Crea los botones como componentes individuales** (si a煤n no lo son).* Si no los has hecho componentes a煤n, selecciona cada bot贸n y presiona **Cmd + Alt + K (Mac)** o **Ctrl + Alt + K (Windows)** para convertirlos en componentes. * **Combina los botones como variantes**:* Una vez que ambos botones sean componentes, selecci贸nalos ambos. * En la barra de propiedades de la derecha, haz clic en **"Combine as Variants"**. Esto convertir谩 a los botones en variantes de un solo componente. * **Configura las variantes**:* Ahora podr谩s organizar las variantes dentro del componente (por ejemplo, un estado **normal** y otro **hover**). * Puedes a帽adir propiedades como **"Estado"** (para cambiar entre los diferentes botones), **"Color"**, etc. * **Utiliza "Change to" en el prototipo**:* Ya que los botones son variantes dentro de un componente, puedes ir al **modo Prototipo** y usar **"Change to"** para hacer la transici贸n entre las variantes de ese mismo componente. Saludos.
En esta clase se avanz贸 desde los fundamentos del prototipado hacia un nivel m谩s profesional y din谩mico usando **After-delay**, **Smart Animate**, **componentes con variantes** y **variables** en Figma. El profesor comenz贸 con elementos ya creados, pero a煤n sin interacciones, pues estaba en modo prototipo. La primera interacci贸n se construy贸 conectando un bot贸n a un **Overlay**. Para lograrlo, se utiliz贸 la opci贸n **"Open Overlay"**, que ya estaba disponible gracias a configuraciones previas guardadas. Se personaliz贸 el Overlay para que apareciera y luego desapareciera autom谩ticamente, aplicando una interacci贸n con **After-delay de 1200 ms**. Esto dio como resultado una experiencia m谩s fluida y profesional. Posteriormente, se reemplaz贸 un bot贸n dentro de la interfaz usando el atajo **Cmd + Option + Shift + V**, y se verific贸 que la interacci贸n funcionara correctamente: al hacer clic, se mostraba el mensaje de que el sendero fue guardado y luego desaparec铆a. Luego, se trabaj贸 con un **scroll vertical (Crawl)** dentro de un **Auto Layout**, donde se clasificaron los senderos seg煤n si ten铆an 谩rboles o no. Para esto, se usaron **variables** que permit铆an filtrar los elementos visibles al activar o desactivar un bot贸n. Por ejemplo, al activar el bot贸n "谩rboles", solo se mostraban los senderos que s铆 los inclu铆an. El profesor aplic贸 estas variables desde el men煤 de apariencia, seleccionando los senderos espec铆ficos y asign谩ndoles condiciones. Aunque en algunos casos los elementos a煤n conservaban su opacidad, no afectaba el scroll ni el dise帽o visual. Finalmente, al conectar las variables a la interacci贸n del bot贸n, el sistema respond铆a din谩micamente, ocultando o mostrando elementos seg煤n su estado. Esto hizo que el prototipo comenzara a sentirse m谩s cercano a una aplicaci贸n real con l贸gica, lo que dio una sensaci贸n m谩gica del potencial que tiene el prototipado avanzado.
Para encontrar donde esta la variable de SoloArboles? pueden acceder por el 驴set? "Prueba": ![](https://static.platzi.com/media/user_upload/image-edcff8fd-fe10-4fcf-88ef-905c477aa284.jpg) ![](https://static.platzi.com/media/user_upload/image-40fc1ba9-a9d3-4bb6-8fba-e74d5a45008e.jpg) Y para crearla de 0 es por aqu铆 mismo en + Create variable: ![](https://static.platzi.com/media/user_upload/image-1a7dd448-0b8a-4f1e-a1e6-c19919a56186.jpg)