Skip to main content
Alex_Murphy
July 17, 2024
Question

Dynamic placeholder image height

  • July 17, 2024
  • 3 replies
  • 575 views

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.

This topic has been closed for replies.

3 replies

y_toku
Figmate
Community Support
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
July 19, 2024

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
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