{"id":"l-fig-3-1","courseId":"figma-ui-design","lang":"en","kind":"lesson","summary":"Turn Steady’s repeated habit row and check button into main components, place instances, override what may change per use, and keep changes flowing from one source.","html":"<p>By the end of Section 2 the habit row exists on the Today screen, twice on Habit detail (“Similar habits”) and once in a search result. Then the brief changes: rows need a 16 px corner radius instead of 12. You find three of the four copies. The fourth ships with the old radius, and a sharp-eyed user posts a screenshot.</p>\n<p>Components exist so that a design decision lives in one place.</p>\n<h2 id=\"sec-1\" tabindex=\"-1\">Main components and instances</h2>\n<p>Select the habit row frame and press <code dir=\"ltr\">Cmd+Option+K</code> (<code dir=\"ltr\">Ctrl+Alt+K</code> on Windows), or use the create component button in the toolbar. The frame becomes a <strong>main component</strong>, shown with a component icon in the layers panel. It is the source of truth. Move it to the <code dir=\"ltr\">Kit</code> page you created in Lesson 1.1, so the screens hold only uses of it.</p>\n<p>Every copy you place from now on is an <strong>instance</strong>: a linked copy. Drag one from the Assets panel, or copy the main component and paste it. Change the main component and every instance updates, in this file immediately and in other files once you publish it as a library (Lesson 3.5).</p>\n<figure class=\"diagram\"><svg class=\"diagram-svg\" focusable=\"false\" viewBox=\"0 0 680 280\" role=\"img\" aria-labelledby=\"l-fig-3-1-t1\"><defs><marker id=\"arrow-l-fig-3-1-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-3-1-t1\">A main Habit row component on the Kit page sends updates to three instances on different screens. Each instance shows its own override: a different habit name, a hidden streak, and a swapped icon.</title>\n  <rect class=\"d-box-primary\" x=\"240\" y=\"20\" width=\"200\" height=\"60\" rx=\"12\"/>\n  <text class=\"d-label-strong\" x=\"340\" y=\"46\" text-anchor=\"middle\">Habit row</text>\n  <text class=\"d-label-muted\" x=\"340\" y=\"68\" text-anchor=\"middle\">main component (Kit)</text>\n  <path class=\"d-arrow\" d=\"M300 80 L120 170\" marker-end=\"url(#arrow-l-fig-3-1-1)\"/>\n  <path class=\"d-arrow\" d=\"M340 80 L340 170\" marker-end=\"url(#arrow-l-fig-3-1-1)\"/>\n  <path class=\"d-arrow\" d=\"M380 80 L560 170\" marker-end=\"url(#arrow-l-fig-3-1-1)\"/>\n  <rect class=\"d-box\" x=\"30\" y=\"172\" width=\"180\" height=\"56\" rx=\"10\"/>\n  <text class=\"d-label\" x=\"120\" y=\"196\" text-anchor=\"middle\">Instance: Today</text>\n  <text class=\"d-label-muted\" x=\"120\" y=\"216\" text-anchor=\"middle\">text: Drink water</text>\n  <rect class=\"d-box\" x=\"250\" y=\"172\" width=\"180\" height=\"56\" rx=\"10\"/>\n  <text class=\"d-label\" x=\"340\" y=\"196\" text-anchor=\"middle\">Instance: Detail</text>\n  <text class=\"d-label-muted\" x=\"340\" y=\"216\" text-anchor=\"middle\">streak hidden</text>\n  <rect class=\"d-box\" x=\"470\" y=\"172\" width=\"180\" height=\"56\" rx=\"10\"/>\n  <text class=\"d-label\" x=\"560\" y=\"196\" text-anchor=\"middle\">Instance: Search</text>\n  <text class=\"d-label-muted\" x=\"560\" y=\"216\" text-anchor=\"middle\">icon swapped</text>\n  <text class=\"d-label-muted\" x=\"340\" y=\"262\" text-anchor=\"middle\">Radius, padding and structure still come from the main component</text>\n</svg><figcaption>One main component feeds every instance; overrides sit on top</figcaption></figure>\n<h2 id=\"sec-2\" tabindex=\"-1\">Overrides: what an instance may change</h2>\n<p>Instances are not frozen. You can <strong>override</strong> content and appearance on any instance: change the text (“Read 20 pages” to “Drink water”), change a fill, hide a layer, or swap a nested instance for another component. Those are everyday edits and do not break the link.</p>\n<p>What you cannot change on an instance is its <strong>structure</strong>. You cannot add a layer, delete one or reorder children; you can only hide what is there. (The one exception is a <em>slot</em>, an area a component author marks as open for free content, which you meet in the next lesson.) That limit is deliberate. Structure is the component’s job, and if every instance could rearrange itself, there would be no component left.</p>\n<p>Overrides have one important rule: <strong>an overridden property stops following the main component</strong>. If you changed one row’s streak color to red for a “streak at risk” mock-up, and later the main component’s streak color changes, that row keeps its red. Figma keeps your override because it assumes you meant it. To bring a property back in line, use reset overrides from the instance’s options in the right sidebar.</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>Overriding as a design method</span></p>\n<p>Changing padding, colors and font sizes instance by instance produces a file where every row is subtly different, and each one has stopped receiving updates for whatever you touched. If you find yourself making the same override three times, the component needs a new option (next lesson), not more overrides.</p>\n</aside>\n<h2 id=\"sec-3\" tabindex=\"-1\">Build small, then nest</h2>\n<p>Look at the habit row and find the pieces that appear elsewhere. The check button also appears on Habit detail. The habit icon, a rounded square with a glyph, appears in the New habit sheet’s icon picker. Make those components first, then use their instances inside the Habit row component:</p>\n<div class=\"code-block\" dir=\"ltr\" data-lang=\"text\" data-index=\"0\"><div class=\"code-head\"><span class=\"code-title\">Text</span><span class=\"code-actions\"><button type=\"button\" class=\"code-btn\" data-action=\"copy\" aria-label=\"Copy code\"><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\"><rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\"/><path d=\"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\"/></svg><span>Copy</span></button></span></div><pre class=\"shiki\" tabindex=\"0\"><code>Kit page\n├─ Check button          main component\n├─ Habit icon            main component\n└─ Habit row             main component\n   ├─ Habit icon         instance\n   ├─ Text stack         frame\n   │  ├─ Habit name      text\n   │  └─ Streak          text\n   └─ Check button       instance</code></pre></div>\n<p>Now a fix to the check button, say a clearer focus ring, reaches every habit row on every screen and the standalone button on Habit detail. Each level stays small enough to understand.</p>\n<p>Name components the way you named layers: by role. Figma groups components in the Assets panel by slash names, so <code dir=\"ltr\">Controls/Check button</code> and <code dir=\"ltr\">Controls/Chip</code> appear together under Controls. Keep the structure shallow; two levels is usually enough for a kit this size.</p>\n<h2 id=\"sec-4\" tabindex=\"-1\">Detaching: the emergency exit</h2>\n<p>You can detach an instance (<code dir=\"ltr\">Cmd+Option+B</code> / <code dir=\"ltr\">Ctrl+Alt+B</code>), which turns it into a plain frame with no link. Sometimes that is right: a marketing illustration that borrows a row’s look, or a one-time exploration on the <code dir=\"ltr\">Scratch</code> page. On a product screen, a detached instance is a future bug. It will miss every fix, and nobody will remember it exists until a user posts a screenshot.</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>Find the source quickly</span></p>\n<p>Right-click an instance and choose to go to its main component, and Figma jumps to the source even when it lives on another page. Use it whenever you are unsure whether you are editing the source or a copy.</p>\n</aside>\n<p>Your row is now one component with linked instances. But Steady needs the row in several states: unchecked, checked, and missed yesterday. Making a separate component for each would be the copy problem all over again. Variants and component properties solve that next.</p>\n","toc":[{"id":"sec-1","text":"Main components and instances","level":2},{"id":"sec-2","text":"Overrides: what an instance may change","level":2},{"id":"sec-3","text":"Build small, then nest","level":2},{"id":"sec-4","text":"Detaching: the emergency exit","level":2}],"takeaways":["A main component is the source; instances are linked copies that update when the main component changes.","Instances can override content and appearance, such as text, fills, visibility and nested instances, but not their layer structure.","An overridden property stops receiving updates for that property only, so override as little as possible.","Build small components first and nest them, so a fix to the check button reaches every row that contains it.","Detaching an instance cuts it off from future fixes; treat it as a last resort and usually a sign the component needs a new option."],"further":[{"title":"Guide to components in Figma","url":"https://help.figma.com/hc/en-us/articles/360038662654-Guide-to-components-in-Figma"},{"title":"Create components to reuse in designs","url":"https://help.figma.com/hc/en-us/articles/360038663154-Create-components-to-reuse-in-designs"}],"quiz":[{"q":"<p>You change the corner radius of the main Habit row component from 12 to 16. Which rows update?</p>","options":[{"text":"Only rows created after the change.","why":"Instances are live links. Existing instances update too, not just new ones."},{"text":"Every instance whose radius has not been overridden.","why":"Correct. Instances follow the main component except for properties you overrode on that instance."},{"text":"None, until you press a publish button in the same file.","why":"Within one file, changes reach instances immediately. Publishing is for sharing to other files through a library."},{"text":"All rows, including detached ones.","why":"Detached rows are plain frames with no link, so they never receive updates."}],"answer":1},{"q":"<p>A designer needs one habit row to show an extra “note” text line, so they detach the instance and add the text. What is the better long-term move?</p>","options":[{"text":"Detach every row so they all match.","why":"That throws away the whole component system. Every future fix would need to be repeated by hand."},{"text":"Keep the detached copy and add a comment explaining it.","why":"A comment does not reconnect it. The copy will still drift as the component evolves."},{"text":"Add an optional note layer to the main component and control its visibility per instance.","why":"Correct. When one use needs something new, the component usually needs a new option, not a one-off copy."},{"text":"Duplicate the main component and edit the duplicate.","why":"Two near-identical main components split every future fix in two."}],"answer":2},{"q":"<p>Why build the Check button as its own component and nest it inside the Habit row component?</p>","options":[{"text":"Figma only allows a component to contain other components.","why":"Components can contain any layers. Nesting is a choice for reuse, not a rule."},{"text":"Nested components are cheaper to export.","why":"Export cost is not the reason. The benefit is a single source for the check button."},{"text":"Nesting hides the check button from developers.","why":"Nesting makes structure clearer in Dev Mode, not hidden."},{"text":"The check button also appears on Habit detail, so one main component keeps both places consistent.","why":"Correct. Fix its focus ring once and it updates in every row and every screen that uses it."}],"answer":3}],"exercise":{"kind":"choice","multiple":true,"options":["edit-text","hide-streak","swap-icon","change-fill","add-layer","reorder"],"correct":["edit-text","hide-streak","swap-icon","change-fill"],"title":"What can an instance do without detaching?","prompt":"<p>You are filling the Habit detail screen with instances of the <strong>Habit row</strong> component (it contains a Habit icon instance, a text stack with Habit name and Streak, and a Check button instance). The component has no slots. Select <strong>every</strong> edit you can make on an instance while keeping it linked to the main component.</p>\n","hints":["Overrides change content and appearance. Structure belongs to the main component.","Hiding is allowed; deleting is not. Swapping a nested instance is allowed; adding a new layer is not.","Four of the six are overrides. The two that change the layer tree are not."],"explanation":"<p>Text, visibility, fills and nested instance swaps are <strong>overrides</strong>: they change what an instance shows, not how it is built, so the instance stays linked. Adding a layer or reordering children changes the <strong>structure</strong>, which only the main component controls (apart from slots, which this component does not have). If one use really needs an extra element, add it to the main component as an optional layer, then hide or show it per instance.</p>\n","checkLabels":{},"optionText":{"edit-text":{"text":"Change the habit name to “Walk 8,000 steps”.","why":"Correct. Text is the most common override and keeps the link intact."},"hide-streak":{"text":"Hide the Streak text layer for a brand-new habit.","why":"Correct. Visibility is an override. The layer still exists; it is just hidden on this instance."},"swap-icon":{"text":"Swap the nested Habit icon instance for a different icon component.","why":"Correct. Swapping a nested instance is an override, and Lesson 3.2 shows how to curate the choices."},"change-fill":{"text":"Change the row background fill for a mock-up of a highlighted row.","why":"Correct, it is allowed. Remember that this row will no longer follow the main component’s fill."},"add-layer":{"text":"Add a new “Note” text layer under the streak.","why":"Instances cannot gain layers outside a slot. Add an optional note layer to the main component instead."},"reorder":{"text":"Move the Check button to the left of the icon.","why":"Reordering children changes the structure, which instances cannot do. A left-handed layout would be a component option."}}},"words":736,"readMinutes":4}