{"id":"l-fig-1-4","courseId":"figma-ui-design","lang":"en","kind":"lesson","summary":"Build Steady’s first screen from frames, text and shapes, choose correctly between frames, groups and sections, name layers by role, and pin elements with constraints so the screen survives resizing.","html":"<p>Sofia’s first review of every new designer’s file starts in the layers panel, not on the canvas. She expands the tree and reads the names. If she sees <code dir=\"ltr\">Group 7</code>, <code dir=\"ltr\">Rectangle 12</code> and <code dir=\"ltr\">Frame 48</code>, she knows the screen will fall apart the moment someone resizes it, prototypes it or hands it to a developer. The canvas can look perfect while the structure underneath is a pile.</p>\n<p>This lesson is about that structure: the containers you put things in, the names you give them and the rules that keep them in place.</p>\n<h2 id=\"sec-1\" tabindex=\"-1\">Frames, groups and sections</h2>\n<p>Figma has three ways to bundle layers, and they are not interchangeable.</p>\n<p>A <strong>frame</strong> is a container with a life of its own. It has a width and height you set, its own fill, stroke and corner radius, and an option to <strong>Clip content</strong> so children cannot spill outside. Only frames can have auto layout, layout guides, and children with constraints, and prototypes move between frames. Press <code dir=\"ltr\">F</code> (or <code dir=\"ltr\">A</code>) and drag to draw one, choose a phone size from the presets in the right sidebar, or select existing layers and press <code dir=\"ltr\">Cmd+Option+G</code> (<code dir=\"ltr\">Ctrl+Alt+G</code>) to wrap them in a frame.</p>\n<p>A <strong>group</strong> (<code dir=\"ltr\">Cmd+G</code> / <code dir=\"ltr\">Ctrl+G</code>) is only a bundle. It has no fill of its own, and its size is whatever its children add up to. Move a child and the group’s bounds change. That makes groups good for one thing: keeping a cluster of shapes together, such as the small trophy illustration on Steady’s streak screen.</p>\n<p>A <strong>section</strong> is a canvas organiser. You use sections to collect related screens, for example “Check-in flow”, and later to mark a whole flow as ready for development (Lesson 4.3). Sections are not part of the UI itself.</p>\n<aside class=\"callout callout-tip\" role=\"note\"><p class=\"callout-title\"><svg class=\"icon \" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path d=\"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5\"/><path d=\"M9 18h6\"/><path d=\"M10 22h4\"/></svg><span><span class=\"callout-kind\">Tip</span><span class=\"callout-sep\" aria-hidden=\"true\"> · </span>When in doubt, frame it</span></p>\n<p>If a layer bundle is part of the interface (a header, a row, a button, a card), make it a frame. You will want padding, a background or auto layout on it soon, and converting groups later is tedious.</p>\n</aside>\n<h2 id=\"sec-2\" tabindex=\"-1\">Building the Today screen skeleton</h2>\n<p>Draw a 393 × 852 frame, a common size for current mid-size iPhones, and name it <code dir=\"ltr\">Today</code>. Inside it, build three frames from top to bottom: <code dir=\"ltr\">Header</code>, <code dir=\"ltr\">Habit list</code> and <code dir=\"ltr\">Tab bar</code>. Inside <code dir=\"ltr\">Header</code>, add two text layers with the text tool (<code dir=\"ltr\">T</code>): “Today” in the Large title style and the date in Subhead.</p>\n<p>Text layers have a resizing mode that matters more than it looks. <strong>Auto width</strong> grows sideways as you type and suits short labels. <strong>Auto height</strong> keeps a fixed width and grows downward, which is right for anything that might wrap, such as habit names. <strong>Fixed size</strong> never changes and is how text gets cut off in other languages. Choose Auto height for habit names: “Meditate” fits on one line, but “Practise Spanish vocabulary for 15 minutes” does not.</p>\n<p>Shapes come next. A rectangle (<code dir=\"ltr\">R</code>) with a 12 px corner radius becomes a row background; an ellipse (<code dir=\"ltr\">O</code>) becomes the check circle. Give every one of them a name by double-clicking it in the layers panel (or <code dir=\"ltr\">Cmd+R</code> / <code dir=\"ltr\">Ctrl+R</code> with the layer selected).</p>\n<h2 id=\"sec-3\" tabindex=\"-1\">Layers: order and names</h2>\n<p>The layers panel is a tree. Children are indented under their parent, and the order is the stacking order: whatever sits higher in the list is drawn on top. If the check circle disappears, it is usually below the row background in the list.</p>\n<p>Name layers by <strong>role</strong>, not appearance: <code dir=\"ltr\">Check button</code>, not <code dir=\"ltr\">Teal circle</code>; <code dir=\"ltr\">Streak</code>, not <code dir=\"ltr\">Text 3</code>. The reasons are practical. Developers read these names in Dev Mode. Smart animate pairs layers between screens by name (Lesson 4.1). Component properties and overrides are easier to manage when the layers they touch are named. And a teammate opening your file at 11 pm before a release can find things.</p>\n<aside class=\"callout callout-mistake\" role=\"note\"><p class=\"callout-title\"><svg class=\"icon \" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\"/><path d=\"M12 9v4\"/><path d=\"M12 17h.01\"/></svg><span><span class=\"callout-kind\">Common mistake</span><span class=\"callout-sep\" aria-hidden=\"true\"> · </span>Fixing structure at the end</span></p>\n<p>“I’ll clean up the layers later” means renaming two hundred layers the night before handoff, and guessing what half of them were for. Name each layer when you create it; it takes two seconds then and twenty minutes later.</p>\n</aside>\n<h2 id=\"sec-4\" tabindex=\"-1\">Constraints: what happens when the frame changes size</h2>\n<p>People use Steady on a 375-wide phone and on a 430-wide one. Constraints tell each child of a frame how to behave when that frame is resized. You set them in the <strong>Constraints</strong> controls of the right sidebar (in the Position section at the time of writing).</p>\n<p>Horizontal options are <strong>Left</strong>, <strong>Right</strong>, <strong>Left and right</strong>, <strong>Center</strong> and <strong>Scale</strong>; vertical options mirror them with <strong>Top</strong>, <strong>Bottom</strong>, <strong>Top and bottom</strong>, <strong>Center</strong> and <strong>Scale</strong>. For Steady:</p>\n<ul>\n<li><code dir=\"ltr\">Header</code>: Left and right, Top. It stretches across and stays at the top.</li>\n<li><code dir=\"ltr\">Habit list</code>: Left and right, Top and bottom. It fills the space between header and tab bar.</li>\n<li><code dir=\"ltr\">Tab bar</code>: Left and right, Bottom. It always hugs the bottom edge.</li>\n<li><code dir=\"ltr\">Add button</code>: Right, Bottom. It keeps its 20 px offsets from that corner.</li>\n</ul>\n<figure class=\"diagram\"><svg class=\"diagram-svg\" focusable=\"false\" viewBox=\"0 0 680 330\" role=\"img\" aria-labelledby=\"l-fig-1-4-t1\"><defs><marker id=\"arrow-l-fig-1-4-1\" viewBox=\"0 0 10 10\" refX=\"9\" refY=\"5\" markerWidth=\"7\" markerHeight=\"7\" orient=\"auto-start-reverse\"><path d=\"M0 0 L10 5 L0 10 z\" class=\"d-arrowhead\"/></marker></defs>\n  <title id=\"l-fig-1-4-t1\">Two phone frames, a narrow one and a wider, taller one. In both, the header stretches across the top, the tab bar stretches across the bottom, and the add button stays near the bottom-right corner.</title>\n  <rect class=\"d-box\" x=\"40\" y=\"20\" width=\"190\" height=\"290\" rx=\"18\"/>\n  <rect class=\"d-box-primary\" x=\"40\" y=\"20\" width=\"190\" height=\"44\" rx=\"18\"/>\n  <text class=\"d-label\" x=\"135\" y=\"47\" text-anchor=\"middle\">Header</text>\n  <rect class=\"d-box-accent\" x=\"40\" y=\"270\" width=\"190\" height=\"40\" rx=\"0\"/>\n  <text class=\"d-label\" x=\"135\" y=\"295\" text-anchor=\"middle\">Tab bar</text>\n  <circle class=\"d-dot\" cx=\"204\" cy=\"244\" r=\"13\"/>\n  <text class=\"d-label-muted\" x=\"135\" y=\"160\" text-anchor=\"middle\">375 wide</text>\n  <path class=\"d-arrow\" d=\"M250 165 L300 165\" marker-end=\"url(#arrow-l-fig-1-4-1)\"/>\n  <rect class=\"d-box\" x=\"320\" y=\"10\" width=\"250\" height=\"310\" rx=\"18\"/>\n  <rect class=\"d-box-primary\" x=\"320\" y=\"10\" width=\"250\" height=\"44\" rx=\"18\"/>\n  <text class=\"d-label\" x=\"445\" y=\"37\" text-anchor=\"middle\">Header: L+R, Top</text>\n  <rect class=\"d-box-accent\" x=\"320\" y=\"280\" width=\"250\" height=\"40\" rx=\"0\"/>\n  <text class=\"d-label\" x=\"445\" y=\"305\" text-anchor=\"middle\">Tab bar: L+R, Bottom</text>\n  <circle class=\"d-dot\" cx=\"544\" cy=\"254\" r=\"13\"/>\n  <text class=\"d-label-muted\" x=\"530\" y=\"230\" text-anchor=\"end\">Add: Right, Bottom</text>\n  <text class=\"d-label-muted\" x=\"445\" y=\"160\" text-anchor=\"middle\">430 wide</text>\n</svg><figcaption>Constraints keep each part of the Today screen in place as the frame grows</figcaption></figure>\n<p>Constraints apply to children of regular frames. Once a frame uses auto layout (next lesson), its children follow auto layout’s resizing rules instead, and the Constraints controls are replaced by those settings.</p>\n<p>Test before you move on. Select <code dir=\"ltr\">Today</code> and drag its edge to make it narrower and taller. If anything floats in the middle, overlaps or gets cut off, its constraints are wrong. Return the frame to 393 × 852 when you are happy.</p>\n<p>Next you replace most of this manual positioning with auto layout, which handles spacing and stacking for you.</p>\n","toc":[{"id":"sec-1","text":"Frames, groups and sections","level":2},{"id":"sec-2","text":"Building the Today screen skeleton","level":2},{"id":"sec-3","text":"Layers: order and names","level":2},{"id":"sec-4","text":"Constraints: what happens when the frame changes size","level":2}],"takeaways":["A frame is a container with its own size, fill, clipping, layout and constraints; a group is only a bundle whose size follows its children.","Default to frames for anything that is part of the UI, and keep groups for loose visual clusters such as an illustration.","The layers panel order is stacking order, and layer names should describe roles, because handoff, prototyping and components all read them.","Constraints tell a child how to move or stretch when its parent frame resizes, such as a tab bar pinned left and right and to the bottom.","Test constraints by resizing the frame to a smaller and a larger phone before you call a screen done."],"further":[{"title":"Frames in Figma Design","url":"https://help.figma.com/hc/en-us/articles/360041539473-Frames-in-Figma-Design"},{"title":"Apply constraints to define how layers resize","url":"https://help.figma.com/hc/en-us/articles/360039957734-Apply-constraints-to-define-how-layers-resize"},{"title":"Explore the navigation bar and left sidebar","url":"https://help.figma.com/hc/en-us/articles/360039831974-View-layers-and-pages-in-the-left-sidebar"}],"quiz":[{"q":"<p>You draw a 393 × 852 phone screen, put a tab bar at the bottom, and set the tab bar’s constraints to Left and right plus Top. What happens when you resize the screen to 430 × 932?</p>","options":[{"text":"The tab bar stays at its old distance from the top, so it floats above the new bottom edge.","why":"Correct. Top keeps the distance to the top edge fixed. A bottom bar needs the Bottom constraint."},{"text":"The tab bar moves to the new bottom edge because Figma detects bottom bars.","why":"Figma does not guess intent. It applies exactly the constraints you set."},{"text":"The tab bar scales up proportionally in height and width.","why":"That would be the Scale constraint. Left and right stretches the width only, and Top fixes vertical position."},{"text":"Nothing changes, because constraints only apply in prototypes.","why":"Constraints apply on the canvas whenever the parent frame is resized, not just in prototypes."}],"answer":0},{"q":"<p>When is a group a better choice than a frame?</p>","options":[{"text":"For the habit row, so its background can stretch with the screen.","why":"Groups cannot hold their own fill or apply constraints to children like a frame does. A row needs a frame."},{"text":"For the whole screen, because groups export faster.","why":"Export speed is not the difference. Screens need frames for size, clipping, prototyping and layout."},{"text":"For a decorative illustration made of several shapes that should move together.","why":"Correct. A loose visual cluster with no layout behaviour of its own is what groups are for."},{"text":"Whenever you want to add auto layout later.","why":"Auto layout lives on frames. Adding it to a group’s contents wraps them in a new frame anyway."}],"answer":2},{"q":"<p>Why does Sofia reject a file whose layers are named “Rectangle 12” and “Frame 48”?</p>","options":[{"text":"Figma slows down when layer names are not unique.","why":"Duplicate or default names do not affect performance. The cost is human and functional, not technical."},{"text":"Default names hide the role of each layer, and features like smart animate and Dev Mode rely on meaningful names.","why":"Correct. Smart animate matches layers by name, developers read names in Dev Mode, and teammates navigate by them."},{"text":"Developers cannot export layers that have default names.","why":"Export works regardless of the name. The problem is that nobody can tell what “Rectangle 12” is for."}],"answer":1},{"q":"<p>The floating add-habit button should stay 20 px from the bottom-right corner on every phone size. Which constraints do you set?</p>","options":[{"text":"Left and Top.","why":"Those pin it to the top-left corner. On a larger screen it drifts away from the bottom-right."},{"text":"Scale and Scale.","why":"Scale keeps proportional position and size, so the button would grow and move on larger screens."},{"text":"Center and Center.","why":"Center keeps it a fixed offset from the middle, which is not the corner on a different screen size."},{"text":"Right and Bottom.","why":"Correct. Right and Bottom keep the 20 px offsets from those two edges fixed while the frame resizes."}],"answer":3}],"exercise":{"kind":"spot-bug","language":"text","code":"Today                    Frame 393×852\n  Header                 Frame   constraints: Left and right, Top\n    Title \"Today\"        Text    resizing: Auto width\n    Date                 Text    resizing: Auto width\n  Habit list             Frame   constraints: Left and right, Top and bottom\n    Habit row            Frame   constraints: Left and right, Top\n      Icon               Frame   constraints: Left, Center\n      Habit name         Text    resizing: Fixed size\n      Streak             Text    resizing: Auto width\n      Check button       Ellipse constraints: Right, Center\n  Add button             Frame   constraints: Left, Top\n  Tab bar                Frame   constraints: Left and right, Bottom","bugLines":[8,11],"title":"Find the layers that break on other phones","prompt":"<p>This is the layer tree of Steady’s Today screen, written out as text with each layer’s type, constraints and text resizing. The screen looks right at 393 × 852, but it breaks on a 430 × 932 phone and with long habit names. Select the line or lines that cause those problems.</p>\n","hints":["Think about what changes on a bigger phone: the width, the height, or both. Which layers should follow the bottom or right edge?","Habit names vary in length. Which text resizing mode cuts off a long name instead of letting it wrap?","Two lines are wrong: one constraint and one text resizing mode."],"explanation":"<p>Line 11: the floating <code dir=\"ltr\">Add button</code> is pinned <strong>Left, Top</strong>, so on a larger phone it stays where it was instead of following the bottom-right corner. Set it to <strong>Right, Bottom</strong>. Line 8: <code dir=\"ltr\">Habit name</code> uses <strong>Fixed size</strong>, so “Practise Spanish vocabulary for 15 minutes” is clipped or overflows. Use <strong>Auto height</strong>, which keeps the width and lets the name wrap. The other lines are fine: short labels such as the title and streak suit Auto width, the header, list and tab bar have the constraints from the lesson, and the row stretches with the list while its check button stays pinned to the right.</p>\n","checkLabels":{}},"words":917,"readMinutes":4}