UX Collective

We believe designers are thinkers as much as they are makers. https://linktr.ee/uxc

Follow publication

Member-only story

How to lock aspect ratios for responsive media in Figma

Felix
UX Collective
Published in
6 min readSep 23, 2024
Image illustrating How to Lock Aspect Ratios in Figma
How to Lock Aspect Ratios in Figma

When designing responsive layouts in Figma, a tricky problem is ensuring that media elements, like images, maintain their aspect ratios while resizing.

This is important when you want your designs to scale smoothly across different screen sizes, without cropping or distorting your visuals.

In this article, we’ll introduce a smart aspect ratio hack that works perfectly for images and other media content. This trick ensures that the image’s height and width both adjust proportionally.

Unlike Figma’s native constraints, which tend to crop or stretch media when resized horizontally, like this:

A Gif showing how Figma crops and distorts your image, when you resize horizontally.
See how the image crops when resizing? We want to override this default behaviour

Why default constraints don’t work

Figma’s “Constrain Proportions” setting might seem like the right tool for maintaining an image’s aspect ratio. However, it has a critical limitation when applied to fluid media.

When you resize the container holding the image horizontally, the height remains fixed, causing the image to be cropped at the edges.

For responsive layouts, where components need to resize across various screen sizes, these behaviours just won’t work.

We need to ensure both height and width resize proportionally while keeping the media content intact.

By the end of this guide, you’ll know how to implement achieve this step-by-step for flawless media resizing in your designs. Let’s get started.

The aspect ratio hack for media

We use a clever trick that involves a hidden container with transparent aspect ratio locks.

The height of your container increases or reduces proportionally based on the width, preventing any unwanted cropping or distortion.

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Written by Felix

Designer, building practical design systems, UI kits, and automation tools. Passionate about making design accessible for all.

Responses (5)

Write a response