Skip to main content
Question

Component with fixed image width but variable image height to maintain aspect ratio

  • June 6, 2024
  • 1 reply
  • 320 views

Jason_Sparks

I want to make a component that has some text at the top then displays an image beneath. The width of the component should always be fixed and the image inside it needs to fill the width of the component but the height of the image needs to maintain the aspect ratio of the image. This would mean that the height of the component must hug to the image so the component height will fluctuate depending on the aspect ratio of the image. How do I do that please?

This topic has been closed for comments

1 reply

  • Figmate
  • 1889 replies
  • June 11, 2024

Hi @Jason_Sparks, Thank you for getting in touch and I appreciate you sharing the details.

Unfortunately, there’s no native way to maintain aspect ratio at the moment, but our engineering team is aware of this need.
Meanwhile, I’ve taken a look around our community and found a few plugins that might be helpful:

Feel free to explore our community for more resources. Also, if anyone has other workarounds, please share them here.

Thanks again for reaching out!


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