Creating a dynamic side-menu item that scales with icons

Hey all!

I’ve been using Figma for about 2 years now at my work, and I’m trying to simplify one of the elements of our pages:

We have a side bar navigation system that has icons (imported via the Bootstrap Icons plug in) that are all sized to as close to 40x40 as possible. Some are rectangular… which is causing the issue.

Each side bar item is as simple as it gets: the icon, which is a component with a long list of variants (23), and a text box next to it. Together, they are grouped as a component, with an auto-layout on it. This makes it so I can adjust the icon, as well as re-write the text next to the icon… and the fill adjusts so that hover effects will work.

However… those icons that are taller than they are wide get squashed.
In the past I’ve “solved” this by making specific components for each and every shape of an icon… but there has to be a better way. Ideally I’d want one component where all icons can be their shape with a text box that expands the hug on the auto layout… what’s the best way to handle that?

Hey I think I solved it. For those looking at this in the future here’s what I did:

Before creating the component with auto layout, I toggled on “Constrain Positions” for the icon. Now each icon is adjusting the component with text accordingly

1 Like

Hey @Luca_Hibbard-Curto, thanks for sharing your workaround to the community!