Hi there,
Thanks for reaching out. Based on what I gather, you may need to use different frames to achieve your desired outcome. I’ve been experimenting further with this playground to see what’s possible: https://www.figma.com/community/file/1033456279024883078
Could you share your file link? I’d like to have a closer look to better understand your needs.
I might have overlooked something, so it would also be interesting to see the community’s feedback.
Thanks,
Toku
Hi y_toku
Thank you for getting back to me.
Here is the figma file
If you look at the modal in preview mode, when you click on the categories on the side, you scroll to the appropriate section, but when you click on another one, the previous one is still in the ‘selected’ mode. So if I click on all the menus, they are all selected, while I would like to have only one selected at a time.
Let me know if there is a setting I haven’t set up correctly or if you have any advice.
Many thanks,
Anaïs
Hey @Anais_Moisy thanks for sharing! Could we get a view access for the file please?
Sorry @y_toku . I just did. You should have access now.
Hi, I am in the same situation. I need to create two interactions on the click trigger. One should change the status to active and “scroll to” content. At the same time, only one clicked option must be shown as active.
You can use variables to achieve a component state change, it’s great for use cases when the click changes a different component state.
Create variables for all your states and one variable to apply the states, this variable will be applied on instance component state dropdown.
Hi, I am facing a similar issue. I have created a button component Default and Pressed state. I put this button on page 1 and 2 of my prototype. On page 1, I press on this button and the button change from default to pressed state. On page 2, I want the same button to be in default state, but it is still in pressed state.
What can I do please?
Have you tried resetting the component state? You can find more information here:
Figma Learn - Help Center
If that doesn’t work, could you provide a bit more detail on what you’re trying to achieve?
Thanks,
Toku
Can you share a video or example. I understand the basics about variables. Use them for color and spacing, but not states and prototypes yet. This is what I’ve been searching for.
Echoing this. I really need an example of how to use variables to turn states on and off in variants. Specifically, I am creating a prototype where I have a nav bar with nav items that have a static, hover, and pressed state. When someone navigates away from the section, I want the pressed state to turn off, but I can’t figure out how to do this.
I made a quick prototype here. I tried to explain my thinking process the best I could. Let me know if you have any questions!
Thank you so much! This is so helpful!
This is great! I reproduced this pattern in my sidebar navigation and after selecting one item it deselects other items (desired behavior), however it also changes the selected item’s label text to its default (undesired behavior).
How did you achieve the behavior when you select “Button 2” it stays “Button 2” and doesn’t change to “Hover”?
Hi @dima16,
It looks like I added text property to my buttons and stored labels for my buttons in those properties.
Ok, this is a huge pain in the ass. Lets be honest: a “on click” “show / hide” interaction (just like UX Pin have) would solve this really quick and easy, however, Figma doesn’t seem to care about this request from the community. Thank you so much!
Yeah I stored the labels in the text property as well but it still returned to the default. Perhaps I did something wrong at another level since I’m using this principle on a rather complex sidebar component or maybe it’s just a bug that doesn’t seem to resolve.
In any case, the workaround I used is I created variants for each of the list items in the sidebar with their own hover and selected states.
Yeah, those overrides can be quite pesky to work with… it’s hard to diagnose without seeing exactly what’s going on in your specific component. Would you be able to share it, perhaps? Maybe in a DM?
You may want to try and clear and recreate overrides…especially if you are working with a complex nested component. Sometimes tracing it back helps to find where the culprit is