Daniel Scott
@dan
In this post, I’m going to show you how to create an awesome User Interface (UI) content card, built with responsive text elements and frames for the ultimate multidevice design experience!
There are some layers of complexity to a design like this, but I have prepared a step-by-step guide so you can understand what’s behind all the adaptable elements we’re creating.
This post is based on my Figma Advanced Course. When you become a BYOL member, you gain access to this course as well as my 30+ additional courses on After Effects, Photoshop, Illustrator, Lightroom, and more. As a BYOL member you will also enjoy personalized support, earn certificates, and tackle exciting community challenges. Head here to sign-up!
UI designers out there, time to activate responsive mode!
Let’s start with a quick review of the elements and settings we’ll be working with.
Frames - Think of frames as canvases for your projects. They are containers for all the UI design elements you bring to a layout. Frames can be shaped as device screens or hold elements like images, buttons, and more. One cool thing about frames is that you can nest frames inside frames!
Components - Components are reusable elements that can be added to multiple frames and projects or shared with your team. Components can include buttons, icons, images, videos, depending on your design’s needs and complexity. Any changes to a main component will be automatically reflected in its instances. One precious tip: you can’t nest a component inside another component. We will have a look into this further ahead.
Instances - Instances are duplicates of a component, sharing that component’s settings and styles. Any changes made to an original component will reflect on its instances. Instances help UI designers save time and resources on their prototypes.
Variants - Variants are, as the name suggests, versions of a component that share equivalent properties but also contain distinctive properties or features. You can create variants of a button component to design it in different states, like inactive, hover, tapping, and others- This saves time by avoiding drawing them one by one for complex design systems and prototypes.
Auto Layout - Figma’s winning feature for dynamic layouts and responsive design. Auto Layout automatically adjusts height, width, spacing, and the position of elements inside a frame or component, making them adapt to content changes or resizing to different screens.
Fixed Width and Height - Use these settings to lock an auto-layout frame’s width and height, regardless of the elements (like text and objects) nested inside and any changes made to them.
Hug Content - Hug is a spot-on name for this feature. When you set an auto layout frame or component to “hug content,” its dimensions expand and contract to wrap its arms around the contents inside, keeping them in a tight fit.
Fill Container - Objects inside an auto layout frame set to “Fill Container” expand to match the width and height of their parent frame. This is a great option for responsive design.
Constraints - Constraints allow you to hold position and sizing of elements nested in frames or components, ensuring that a layout remains intact across diverse screens and devices. They are defined by four attributes: Horizontal, Vertical, Width, and Height constraints.
Let’s move on and see how all of these concepts join forces to create awesome UI content for your prototypes!
We’re going to create a basic UI card for our text, working with the elements below:
These are the elements we’re combining to create a responsive UI card.
A frame with an image of a good-looking dude as a Fill
A label with a well-known brand
A “Join Now” call-to-action button.
A second frame with a green fill and a text object inside. We’ll be working closely with this one. I wrote a long message so the responsive behavior is easy to watch.
Let’s start setting up both text and frame for responsiveness. With both elements selected, we move our mouse to the Properties Panel on the right of our workspace and click the + sign next to Auto layout.
Auto layout will is vital for your UI responsive design needs
We’re now deciding how the text object is positioned inside the frame. As we can see in the options below, we can adjust orientation, spacing between objects, horizontal and vertical padding, and alignment. In the image below, I’ve set a vertical padding value of ten pixels. This means we have 10 pixels spacing between the text object and the frame’s vertical edges.
Padding, vertical or horizontal, sets the distance between frame edges and objects nested inside.
Next, we click and drag the call-to-action “Join Now!” button and release it inside the frame. Auto layout adjusts automatically to fit all the settings we’ve defined earlier.
We’re going to create three versions of this frame, so we can quickly switch between states when we’re prototyping. The first step is to turn our auto layout frame into a component. There’s nothing complicated about this, we select our layer with the Move tool and click on the Create Component button placed in the Toolbar above our workspace. We can also use the shortcut Command + Option + K on a Mac or Control + Alt + K on a PC.
Components and variants are valuable time saving resources.
Now that you know what components are and why they are so important to UI design, I bet you can guess what we’re going to do next. High five if you are thinking “let’s create variants!” With your component selected, move to Properties, and click on the Create component property button, the one with a + sign. Next, click on Variant inside the drop-down box.
Variants speed up your workflow as you design similar elements with different features.
A new + icon will appear below our component. Let’s click on it to duplicate the frame and once more to get a second copy. Our component now holds three variants ready to be changed.
Name variants consistently so you and your team members can easily identify them during the design process.
Let’s name our variants so we can easily identify and change states when we’re working on our prototype. First, we can name the property we’ve set for our component. I’ll call it Box (you can give yours any other name). Then we can add names to all our variants. I want the first two variants to fit a horizontal auto layout, perfect for computer screens. For the third variant, I need it to fit a vertical auto layout, great for smartphone screens.
Let’s start playing with responsiveness. We’re going to remove the call-to-action button from the second variant and make the text frame automatically fill the empty space.
Remember we’re working with an auto layout. Figma reacts to any changes and rearranges our frame according to the auto layout settings we’ve defined. Now we’re going to give the text one special instructions.
We double-click the text frame to select it, move to Position and Size properties on the right panel, click on the Horizontal resizing dropdown and select Fill Container. We’re asking Figma to adjust the text frame to always fill the nest frame’s dimensions horizontally.
Make sure that the nest frames (the green ones) on each variant have a Fixed Width set for the same horizontal resizing option and repeat the Fill Container setting for all text elements.
Set your text frame to expand or contract according to other elements inside the green nest frame.
Now let’s double-click the “Join Now!” button inside the second variant to select it. We want to remove it, so there are two ways to do it: we can hit the delete button and it’s gone, or we can use the non-destructive approach, and move to the Layer panel to the right of the workspace and click on the eye icon to hide the button.
Hiding an object is the smart non-destructive design choice.
As we can see above, when we hide the button, the text automatically expands to fill the frame’s dimensions. We are creating responsive text! How cool is that?
Before moving on to prototype action, let’s finish our component by changing the third variant auto layout frame to vertical orientation.
With the third variant selected, we move our mouse to the Auto layout panel and set orientation to vertical, clicking on the down arrow icon. Next, we align the elements inside to the bottom center position.
You can use different Auto layout orientation options as you design your elements.
And we’re set to move on, create the UI Card, and start prototyping!
Timeout #1
Responsive design isn’t an option for UI designers. Read this article to fully understand the design approach that unifies the best website or app experiences across diverse devices and screens.
Now let’s put all the pieces together!
First, let’s select the frame with the image fill, make it a Component and name it BYOL Card. Turn the call-to-action button and brand and name frame to components and name them “Join” and “Dan,” respectively.
“BYOL Card” will be the UI card main component and the other elements will be nested inside. What did we learn at the start? We can’t nest a component inside another component! So, what’s the right course of action? Instances!
On the Layer panel to the left of the workspace, we click on Assets, and select the component we need by clicking and holding the left mouse button. Drag it into the UI Card to place an instance of that component inside. As simple as that!
Do the same with all the other instances until your UI Cards looks like this:
Your UI card component is ready for your prototype. Use instances to duplicate it across the project in seconds!
Let’s test our UI Card now. I’ve created a new frame, filled with white color, and it's really simple. Let’s place two instances of the UI card component inside it.
Let’s start by checking text responsiveness to the “Join Now!” button. We’ll leave the first instance unchanged for now. Select the green text frame by double-clicking on it.
Inside the Properties panel, change the variant from “Horizontal On” to “Horizontal Off.” You may have named these differently, it’s perfectly fine, just make sure you’re selecting the second variant.
You can easily switch between variants to streamline your design and prototyping work.
This is the quickest way to create a series of UI Cards with different elements combined while keeping them all responsive to change.
Let’s dive a little deeper down the rabbit hole!
Time to change the UI card size to fit different screens. Double-click the text frames to make sure horizontal resizing is set to Fill and vertical resizing is set to Hug.
Responsive design can be tricky, make sure you check your Auto layout settings as you build your prototype.
Now we select the entire UI Card, click and hold one of the corners and drag it horizontally. As we change the card’s size, the text responds to the new dimensions and automatically adjusts its position.
Play around with your UI card dimensions to watch text responsiveness at work. It’s incredible!
Awesome! Now let’s imagine we want to align three UI cards side by side on a small screen and watch how responsive behavior works on a vertical auto layout.
First of all, let’s select the green frame and switch it to the third variant, the one with text and call-to-action button.
Different screen sizes demand for dynamic design solutions. Careful planning saves time and resources.
Second, let’s make sure the auto layout settings for the green frame are correct. We need a horizontal resizing set to Fill Container and vertical resizing set to Hug. Auto Layout is set vertically with all elements aligned to the bottom center.
Element position must be thoroughly considered to keep your layout balanced and usable across different screens.
Now it’s time to make the responsive magic happen! Click and hold the left mouse button over one of the corners and start dragging to change the card’s dimensions. Text adjusts to fit the new frame size! So cool!
Wow! It’s incredible how text and elements logically adjust to a significant frame width change!
UI designers need to prototype for a wide range of devices and screen sizes, while also keeping in mind users with different backgrounds as well as accessibility requirements. Responsive design is vital to meet all these needs and keep workflows efficient and organized.
Use Auto layout and responsiveness to create versatile UI solutions for websites and apps, across many devices.
Timeout #2
This article on responsive design that blends best practices with real-world examples will inspire you to create your own incredible prototypes!
There is complexity in responsive design. Connecting everything to provide a smooth and seamless user experience will take time and lots of testing. But it’s incredibly fun to work with and will take your skills to the next level!
When you become a BYOL member, you will gain access to my Figma Essentials and Advanced courses as well as my 30+ additional courses on Photoshop, Illustrator, Lightroom, Premiere Pro, Webflow, and more. As a BYOL member you will also enjoy personalized support, earn certificates, and tackle exciting community challenges. Get started here.
See you in class! – Dan