Is it possible to change a component state after clicking on another component?

Hi,

I have a side panel with buttons, and when clicking on one of the categories, the main screen slides to the correct categories. This works great.

The buttons are in variant components with three states (default, hover, and selected).

When I click on the button, I have two interactions set up in the prototype:

  • ‘scroll to’ (to scroll to the section)
  • ‘change to’ : state = selected

My issue is that I want the button to go back to the default state when I click on another one. Is there a way to do that? (for now, they all become selected when I click one after the other).

Thank you in advance,
Anaïs

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.