Skip to main content
Question

Dynamic placeholder image height


Alex_Murphy

I have a component setup that looks like this. (Example attached below)

The placeholder image is set to ‘fill’ width / ‘640’ fixed height. I’m using this component in many places in my design file. Not all images I add to the placeholder fill the height in the design file. (Example attached below)

Can the height of this placeholder be adjusted depending on the size of the image placed? Otherwise, I’ll have unnecessary white space at the top and bottom of the image if it doesn’t fill the full placeholder space.

3 replies

y_toku
Figmate
  • Community Support
  • 2217 replies
  • July 19, 2024

Hi there,

Thanks for the post. I thought it might be achievable by using auto layout with the Fill option, but it doesn’t seem that straightforward.

Let’s wait for the community to respond and see if anyone has any tips.

Thanks,
Toku


Marian_Brchan

One way is to use a component for the images but that’s a bit too complicated:

Or if you don’t mind some cropping on the images, make sure the setting is set to Fill:


y_toku
Figmate
  • Community Support
  • 2217 replies
  • July 23, 2024

If you want to keep Aspect Ratio, it’s not possible unfortunately at the moment. One of the alternatives is to use a plugin like this for now
https://www.figma.com/community/file/873125264217713781

I hope it helps!

Thanks,
Toku


Reply


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