Buttons Do Not Get Pushed Down

Hi there! I designed the sidebar menu option with dropdown buttons but I am not being able to animate the buttons in a way that the selected one would drop down and push the other button below. Help?


Hey Rishikesh! This should be a straightforward fix, hopefully without too many steps. The main thing is ensuring you’re using auto layout in a few key places:

  1. Make sure you’re using auto layout on the buttons’ open and closed states.
    A) It might not be required, but it would be good practice to add auto layout to the component’s containing frame (the purple dotted line one that houses the variants for the state).
  2. Make sure you’re using a vertically oriented auto layout frame that contains the instances of the buttons for your prototype.

One of the least complicated ways to set this up would be to make a component for every unique button and dropdown that you need in your prototype. This component will use interactive variants. You’ll have a property with two variants. What you name the property and variants doesn’t matter; I went with “Menu visible” for the property name and “True” and “False” for the variants:

Something else that is important is the layer structure. You’ll want to use an auto layout frame to create the button, and another auto layout frame to hold the menu items that drop down when the button is clicked. On the “False” variant that “List item container” frame will be hidden, and visible on the “True” variant:

As I mentioned with the second point, it’s crucial that your buttons (I’ve named these “Accordions” in my example file) are in a vertically oriented auto layout frame, like so:

This set up should get you the desired result! Here’s a GIF showing what this looks like in a prototype:

Rishikesh 1

If it’s helpful, here’s a view-access link to the file I used to make these screenshots and GIFs. You can get an editable copy as well in case you’d like to dig into the layer structure. Hope this was helpful!

1 Like

Thank you so much! I was using the auto layout feature but was making a dumb mistake while copying the component inside the frame. I eventually got it right. Thanks a lot for this effort! Love and respect my friend.

1 Like

glad to hear you got it sorted out!! I’ve done the same thing before, so no worries.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.