







When you build app screens or web mockups, you eventually realize you're doing the same thing over and over. One button label gets longer, so you resize the button, then go through ten screens that use it to fix each one the same way. A card gains a line, so you drag the elements below it down one by one. The bigger the project, the more time you spend tidying instead of designing.
This is why UI design tools have the concepts of frames, auto layout, and components. These three are devices for making designs whose shape holds up “even when the content changes.” Setting them up takes a bit of time at first, but the more often a design gets revised, the more time you get back beyond what you put in. And a mockup built with these devices is much easier for a developer to understand once it's handed over, because real apps and websites are built on the same principle: boxes and rules.
In this article, on the assumption that you're building an app screen mockup, we look at what problem each of the three concepts solves, in turn.
1.How to group units like buttons and cards with frames.
2.How to make parts that stretch on their own with their content using auto layout.
3.How to manage repeated parts from a single original with components.
4.How to extend to multiple screen sizes and a design system with constraints, grids, and styles.
5.A walk-through of building one login screen to tie the flow together.
If an artboard is one finished piece of output, a frame is a small box you put inside it. If you make the units that compose a screen, such as buttons, cards, and a single row of a list, into frames, you can handle the elements inside as one lump. In Opkle Editor, press F and drag inside the artboard to make a new frame, or select elements you've already drawn and press ⌥⌘G to make a frame that wraps them.
When you select a frame, Clip On · Off appears in the inspector. With it on, content that goes outside the frame appears cut off, which is useful for putting a photo inside a card or imitating a scroll area. Beginning to see a screen not as a collection of simple shapes but as a structure of boxes is the first step of UI design.
Frames can be placed inside other frames. The whole screen is a large frame, with a header bar, a list, and a bottom tab bar going in as frames, and card frames going inside the list, and so on. In a structure nested this way, the keys that step in one level with Enter, select the parent one level out with ⇧Enter, and move to the next element with Tab are especially useful. You can move along the structure without hunting with the mouse.
Auto layout is a feature where, instead of placing elements by hand, you set rules and elements are laid out according to them. Select a frame and click Auto Layout Settings in the inspector, or press ⇧A, to turn it on. You can check the result in the preview on the left while setting values, so it isn't hard to get a feel for it even at first. You can also drag elements in the preview to change their order.
The rules are simpler than you'd think. Choose whether to line elements up horizontally, stack them vertically, or place them in a grid, and decide whether to wrap when they overflow. Then set the spacing between elements and the padding inside the frame, and choose the alignment for where the elements gather. The alignment can also be chosen by clicking one of the nine zones in the preview directly, so when it's hard to put into words, clicking the spot you want is faster.
Finally, decide whether to fix the frame size or leave it to fit. Leave it to fit and the frame grows along with the elements inside, so you get a button that stretches on its own with the text length. Even if “OK” becomes “Pay and Continue,” the button widens by itself, and if a card gains a line, the card lengthens by itself. Once you've experienced this ease, it's hard to go back to making mockups without auto layout.
For spacing and padding, it's good to settle on a handful of numbers and use only those. For example, if you settle on 4, 8, 16, and 24, the whole screen gets a consistent rhythm, and it's easy for someone else who takes over to follow the same rules. Auto layout is also a device that locks those rules in as numbers.
Elements used repeatedly in many places, such as buttons, icons, and cards, are best made into components. When you edit the original, all the copies made from it, the instances, follow along, so you no longer have to go through ten screens to change one button color. Select a frame and press ⌥⌘K, or make one from the Component group in the right-click menu.
Not everything has to follow the original. If you want to change just one place separately, select that instance and detach it with ⌥⌘B, and it no longer follows the original. But a detached instance doesn't reconnect, so it's wise to detach only after making sure it really is an element to manage separately. Buttons with different states, such as default, pressed, and disabled, can be grouped as variants and managed in one place.
The components you make gather in the Assets window of the Component Assets section on the right. Because it also shows ones made in other projects, you can use the same parts across projects, and versions are attached according to how many times they've been edited. You can also check whether one is being used in the current file, so even as parts multiply, keeping things organized isn't hard.
Apps and websites don't end at one screen size. You have to think about how the same design looks on a phone, a tablet, and a desktop. This is where constraints and layout grids come in.
Staying in place when the screen changes
Select an element and click Constraint Settings, and you can set what the element attaches to and follows when the artboard size changes.
If you set the top-right close button to “right and top,” and a top bar that spans the full width to “left and right,” they stay in place even when the screen width changes.
Laying a layout grid on an artboard or frame makes it easier to align to columns and rows, and ⌃G toggles its visibility.
Placing mobile, tablet, and desktop screens side by side as several artboards and matching them to the same grid keeps a responsive mockup neatly organized.
As parts and screens multiply, it's time to manage color and text by rules as well. If you make fill styles, paragraph styles, and vector styles, fixing one style changes every place that uses it. With color variables that hold two values, light and dark, you can view the light and dark versions of the same screen side by side without drawing two sets. Components, styles, and color variables together make a small design system.
Concepts get into your hands fastest when you actually build something. Take a simple login screen as the example.
First, make a phone-sized artboard and place one frame in it with vertical auto layout turned on. Into this frame, put the logo, the title text, two input fields, the login button, and the note text below, in order. Set the spacing to 16 and the padding to 24, and the elements stack vertically at even intervals. Make one input field a frame, set its padding with auto layout, and turn it into a component, and the second input field is done by placing one more instance.
Make the button a component the same way and leave its width on fit, and it becomes a button that stretches with its text. Now try changing “Log In” to “Continue with Email.” The button stretches, and the note below it is pushed down automatically. Finally, duplicate this artboard, change it to tablet size, and set the outer frame's constraint to “center,” and you have a mockup where the login box stays centered even as the screen gets wider.
After going through this flow once, you realize that frames, auto layout, and components aren't separate features but a single way of thinking: divide the screen into boxes, give the boxes rules, and tie repeated boxes to an original.
When the mockup is finished, it's good to organize the images to hand to developers too. Save the format and scale for each layer in the export settings and press ⇧⌘E, and icons come out as SVG and images as PNG at 2x, all at once. Whenever the design changes, the same shortcut once does it, so even handoff becomes a rule rather than repetition. The layer name also becomes the file name, so don't forget to name layers clearly.
You don't need to make everything a component or style from the start. Begin with the single button you use most: group it as a frame, turn on auto layout, and convert it to a component. Place that button in a few spots on the screens and change the original's color, and you'll understand at once why the three concepts go together.
Key Takeaways
Frames let you see a screen as a structure of boxes like buttons, cards, and lists, and you can move along that structure with Enter, ⇧Enter, and Tab.
Auto layout places things by rules for spacing, padding, and alignment, making parts that stretch on their own with their content.
Components tie repeated parts to one original, so a single edit changes every screen.
Constraints and layout grids keep things consistent across screen sizes, and styles and color variables do so at the design system level.
Building one login screen gets the one way of thinking, “divide into boxes, give rules, tie repetition to an original,” into your hands.
