Apologies if this is simple or has been asked before but I can’t find a solution.
I have a component that needs to have a fixed width but the height can vary depending on the ratio of the image at the top of the component.
I need the ability for the image to keep the fixed width but adjust the height in proportion to the files ratio. No matter what I do the image container never seems to adjust and there isn’t a hug option on the image. This means if I select a landscape image instead of pulling all the content up the image frame stays the same size with the image flowing in the middle.
Hello @Lee8, Thank you for reaching out about image fill. I truly appreciate you sharing helpful information with us!
In Figma, images are not treated as their own object type, but rather as fills. The interesting part is that because images are treated as fills, you can use this method to add your selected images to pre-existing shapes. Within that shape, you can switch the Fill mode between Fill, Fit, Crop, and Tile.
It seems that the image mode in your component is Fit. Fit ensures that the full image is always visible within your shape, which may result in blank space (padding) around the image. While we want to help you achieve to adjust the height, I couldn’t find any resources to help removing the space around the image.
I hope this clarifies things a bit. We regret that we might not be able to fulfill your request at this time, but we think what you want to achieve is a very appealing suggestion. If you’d like, please post your idea to “Share an idea” category.
Let us know if I missed anything! We also welcome any insights, workarounds, or helpful plugins from community members, so please feel free to share!
Thank you.
FYI: I found a post that almost same as this post. I unlisted that to maintain our forum tidy.