Hi there.
I’m trying to figure out how I can design a dropdown menu component which is not affected by the layers stacking order.
Actually, my design system is a kind of a lot of Russian dolls, with component instance customization everywhere.
I’ve created a little sandbox file to demonstrate what’s possible, it’s here:
The stacking order indicator is made by the red rectangle.
On the left, a dropdown menu which is affected by the layer stacking order, but has some advantages : auto-layout can adjust the menu width…convenient.
On the right: the same dropdown menu but this one is not affected by the stacking order. Nice but some problems:
the overlay is not managed by the same auto-layout of the selector, so difficult to make its width easily affected
Look at the position of the overlay in the prototype interaction → totally impossible to figure out how to set the position of the overlay…or there is something I didn’t catch
Feel free to comment, share your thoughts, ideas, etc.
Thanks.
Thanks @Nate_G. But that doesn’t fix the problem when your design is made of several stages of nested components.
It works in this particular case because you explicitely specify the stacking order. So, in a industrial way of design (=I can take a dropdown component and put it here and it works), it’s not a magic solution.
But your clever way of setting the height gives me some hints to experiment some ideas. Many thanks!
The best way to make a prototype is to have dropdown overlay and dropdown trigger components separated and connect them with “Open Overlay” interaction. To avoid repetitive work you can wrap it into a temporary local component to be used for prototyping purposes
Thanks that’s what I did in the file here above. It works, but check it out, you’ll see there is an issue about the overlay positioning, plus the overlay can’t shrink or expand depending on the auto layout, right?
Now I can put this small block on top of any element I want to have normal overlay interaction. It is always on top of everything you have, you can close it by clicking outside, it’s neat!
Pair both the trigger and the overlay into a single component and and you will get auto-width behaviour. There are two serious drawbacks. You will not be able to close the overlay when clicking somewhere else and you would have to constantly fight overlapping issue.
Other way is to decouple trigger and the overlay and use “Open Overlay” interaction which will enable close on click outside and no overlapping issue. However the size of the overlay to be adjusted manually. For me it’s not a big deal. You can have your overlay as a component instance that you can duplicate as many times as you need to have various sizes available.
Setting up is not an issue as you still need to customize your menu for each different dropdown type you have.
Pair both the trigger and the overlay into a single component and and you will get auto-width behaviour. There are two serious drawbacks. You will not be able to close the overlay when clicking somewhere else and you would have to constantly fight overlapping issue.
Yes, that is the left case in my example file.
Other way is to decouple trigger and the overlay and use “Open Overlay” interaction which will enable close on click outside and no overlapping issue. However the size of the overlay to be adjusted manually. For me it’s not a big deal. You can have your overlay as a component instance that you can duplicate as many times as you need to have various sizes available.
Yep, and that’s my second try.
The main issue I see here is it works with a prototype and not with component interactions…more precisely, it works with component interactions, but it’s nearly impossible to define the position of the dropdown.
Thanks again for your messages. I’ll live with these limitations and try to get the most of the overlay solution which seems the most interesting.
But you’re right, considering the current Figma capabilities, the best way is to use an overlay and setup the interactions at the prototype level, not on the component itself.
Hi my way of making interactive dropdown components is to use the position absolute option inside the component for the list element and the swap instance option for the ability to dynamically swap lists. So i don’t need overlay option because all the interaction takes place inside my component.
To avoid overlapping elements it is worth changing the Canvas stacking options to “first on top” for the autolayout parent.