Dynamic product mockup library in Figma: UI views and device frame variants

Valeria Gasik
Bootcamp
Published in
4 min readFeb 18, 2021

--

👩🏻‍🔬 A short walk-thru.

Please note: this post assumes that the reader is familiar with the basics of Figma libraries, components and variants as they are in February 2021.

Let’s say you’d like to compose a little Figma mockup library, featuring a few different devices and your app’s key UI views. A library that can be attached to other Figma projects, so you could simply drag and drop the latest device mockups with your app’s screens on whatever background or photo you choose — and then post to your blog or SoMe.

There are plenty of plugins and 3rd party apps you can already use to create mockups quickly, such as

to name a few.

While all of these tools work a little bit differently, they all have one thing in common: the screen on the mockup is an image — not an editable, automatically updated frame or a component instance.

Websites like Previewed and Threed use screenshots to generate device mockups. Mockuuups.studio plugin uses Figma frames to compile a variety of device mockups, from which you can then pick an image of your liking.

Angle 3 plugin is the closest to the “real deal”: the mockup includes a vector shape. This vector shape gets covered with an image. And this image is generated from your UI frame. In other words, you don’t have to leave Figma or export any images; the plugin does it for you.

For most use cases downloading a screenshot and uploading it to such services (or using the plugins as described) is enough.

But what about the moment, when your mockup is updated?

I was curious to test whether the mockup update could be a bit more robust and automatic. Here’s what I did.

1. Create UI screens

Build up new UI frames or bring existing screens to your Figma library.

It’s smart to think a bit ahead of what kind of device frame you will use — and pick the correct frame size for your app views.

Two mockup screens for an imagined app.

2. Find suitable device frames

Draw simple shapes that resemble device frames, import SVG shapes from e.g. Illustrator, or find and import vectors from any relevant mockup libraries. The key thing here is to have:

  • a device frame
  • a vector shape that would work as your screen mask

Tip! If you like some variety for your devise frame, combine them under one variant. Here I have light, dark and translucent frames:

Device mockups are adopted from an “iPhone X mockup” template.

3. Mask UI frames with device screen shapes

Okay, this needs a bit of unpacking.

Chances are that your UI frame and screen shape are different in scale.

Regular resizing vs. scaling — hotkey “K”.

Start by turning your UI frame into a component.

Why a component and not a simple frame? Well… you don’t want to have to edit several screens, right? The idea is to apply future updates to one master component only and see the changes cascade to all your device mockups at once.

Then, drag an instance of that component close to the screen shape.

Now, if you simply resize it, it’s likely that elements on your UI will not grow correctly. To make sure all elements grow as they should use the scaling tool, hotkey “K”.

After that,

  1. place your instance above the mask shape
  2. select the underlying shape and the UI view
  3. and create a mask group (control + command + M)

Make sure to uncheck “Clip content” on your UI frame.

This might sound a bit strange; isn’t the point of the mask to clip content? In any case, if you have that checkbox selected, the mask will not be applied.

Here, I had to make my “Home” master component a bit longer, so it would work well with the dark mask shape.

4. Compile your mockup

The last phase is about gathering all elements together. Create a new key component that includes

  • device frame instance
  • screen: mask shape + your UI instance

If all went well, the end result is a mockup with an automatically updated UI view. You can swap the UI view to another screen and you will see any updates instantly.

Hopefully, this little walkthru was helpful! How would take this idea further? 😊

--

--

Designer, feminist | valeria.cx | willandway.io | Discussing tech ethics, designops, design leadership, feminism and being human to self and others 🌻 UA, FI