Skip to main content
Solved

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.
Untitled
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?

Best answer by Luca_Hibbard-Curto

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

View original
This topic has been closed for comments

2 replies

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


Celine_D
Figmate
  • Community Support
  • 3443 replies
  • November 7, 2023

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings