Components: reusable building blocks
A component is a reusable UI building block you create once and use many times. In Figma, the original is the Main component (the source of truth). Every time you place it into a design, you create an Instance (a copy that stays linked to the main).
- Main component: you edit it to change the design everywhere.
- Instance: you can override certain properties (like text), but structure and styling stay linked unless you detach.
Why instances matter
- Update once, propagate everywhere (button padding change, corner radius, icon size, etc.).
- Fewer inconsistencies (no “almost the same” buttons).
- Faster prototyping (swap variants for states/sizes instead of duplicating frames).
Instance overrides vs detaching
Instances allow safe overrides (like changing a label) while keeping the component linked. Avoid detaching instances unless you truly need a one-off custom element. Detaching breaks the link, so future updates to the main component won’t apply.
Plan a mini UI kit: what we’ll build
You’ll create foundational components that can cover most beginner login flows:
- Button (with variants for state and size, plus optional icon)
- Text input (with variants for state and size, plus optional leading icon)
- Top bar (title + optional back icon)
- Icon button (icon-only control with state/size variants)
Then you’ll convert your login screen elements into components, replace duplicates with instances, and organize everything on a dedicated UI Kit page.
Set up a dedicated UI Kit page
- Create a new page named
UI Kit. - Add a frame named
Components(this is just a container to keep things tidy). - Inside, create sections (frames or simple headings) like:
Buttons,Inputs,Navigation,Icon Buttons.
Keeping components on a UI Kit page makes them easy to find, audit, and update.
- Listen to the audio with the screen off.
- Earn a certificate upon completion.
- Over 5000 courses for you to explore!
Download the app
Component naming and structure (beginner-friendly rules)
Naming convention
Use a consistent, readable pattern. A common approach:
Button / PrimaryInput / TextTop Bar / BasicIcon Button / Standard
For variants, you’ll define properties like State and Size so you don’t need separate names for every combination.
Variant property recommendations
| Component | Properties | Example values |
|---|---|---|
| Button | Type, State, Size, Icon | Primary; Default/Hover/Pressed/Disabled; S/M/L; On/Off |
| Input | State, Size, Leading icon | Default/Focus/Error/Disabled; S/M/L; On/Off |
| Icon button | State, Size | Default/Hover/Pressed/Disabled; S/M/L |
| Top bar | Back | On/Off |
Keep property names short and consistent across components (e.g., always use State, not Status in one place and State in another).
Build 1: Button component (with variants and property controls)
Step-by-step: create the base button
- In the UI Kit page under
Buttons, draw a button container (a frame). - Place a text layer inside for the label (e.g., “Sign in”).
- Ensure the button frame uses auto layout (horizontal) so padding and spacing behave consistently.
- Add optional icon layer (e.g., a left icon) inside the same auto layout row.
- Name layers clearly:
IconandLabel.
Convert to component
- Select the button frame.
- Convert to component (this becomes the main component).
- Name it
Button / Primary.
Create variants for size (S/M/L)
- With the main component selected, create variants.
- Set a property named
Sizewith values:S,M,L. - Adjust padding and text size per size variant (keep icon size consistent or scale slightly—choose one rule and stick to it).
Create variants for state (Default/Hover/Pressed/Disabled)
- Add a property named
Statewith values:Default,Hover,Pressed,Disabled. - For each state, adjust visuals (examples):
- Hover: slightly darker background or stronger shadow.
- Pressed: darker background and/or reduced shadow.
- Disabled: lower opacity and ensure label contrast remains readable.
Add an icon toggle (Icon On/Off)
Beginner-friendly approach: create a variant property that controls whether the icon exists.
- Add a property named
Iconwith valuesOnandOff. - In
Icon=Offvariants, remove the icon layer (or hide it and ensure spacing collapses correctly). - In
Icon=Onvariants, keep the icon visible.
Tip: If spacing doesn’t collapse when the icon is hidden, it usually means the icon is still taking space in auto layout. The simplest fix is to remove the icon layer entirely in the Off variant.
Expose the label as a text property
Instances should let you change “Sign in” to “Create account” without detaching.
- Select the component.
- In the right panel, create a text property for the
Labellayer (Figma will expose it so instances can edit it). - Test: place an instance and change the label text from the instance panel.
Build 2: Text input component (with state/size and optional leading icon)
Step-by-step: create the base input
- Under
Inputs, create a frame for the input field. - Inside, add:
- A placeholder text layer (name it
ValueorPlaceholder). - An optional leading icon layer (name it
Leading icon).
- A placeholder text layer (name it
- Use auto layout horizontally so padding and spacing are consistent.
- If your design includes helper/error text below the field, consider making it a separate component or a second component type (to keep the base input simple).
Convert to component and create variants
- Convert the input frame to a component named
Input / Text. - Create variants with properties:
Size:S,M,LState:Default,Focus,Error,DisabledLeading icon:On,Off
State styling guidance
- Default: neutral border.
- Focus: stronger border or focus ring.
- Error: error-colored border (and optional error message component below).
- Disabled: reduced contrast and ensure text remains legible.
Expose text properties for placeholder/value
- Create a text property for the placeholder/value layer so instances can change “Email” to “Password”.
- If you use a label above the field, expose that as a text property too (or keep labels outside as separate text layers if your layout varies).
Build 3: Top bar component (title + optional back button)
Step-by-step
- Under
Navigation, create a horizontal frame for the top bar. - Add a title text layer (name it
Title). - Add a back icon on the left (name it
Back icon). - Use auto layout to control spacing and alignment.
Convert to component and add a Back toggle
- Convert to component named
Top Bar / Basic. - Create variants with a property
Back:On,Off. - Expose the title as a text property so instances can switch “Login” to “Create account”.
Build 4: Icon button component (for small actions)
Step-by-step
- Under
Icon Buttons, create a square frame with an icon centered inside. - Name the icon layer
Icon. - Convert to component named
Icon Button / Standard.
Create variants for size and state
- Add
Size:S,M,L(adjust frame size and icon size). - Add
State:Default,Hover,Pressed,Disabled(adjust background/opacity).
Allow icon swapping
For beginner workflows, the easiest method is to swap the icon layer in an instance by replacing it with another icon component (if your icons are components) or by using “Swap instance” if the icon is an instance. Keep icon layers consistently named (Icon) to make swapping predictable.
Structured build: convert your login screen into components
Now apply what you built to your existing login screen without rebuilding the entire layout.
Step 1: Identify duplicates on the login screen
- Primary action button (e.g., “Sign in”)
- Secondary actions (e.g., “Forgot password?” might be a text link, not covered here)
- Email and password inputs
- Top bar title/back
- Any icon buttons (e.g., show/hide password, close)
Step 2: Replace duplicates with instances
- Go to the login screen.
- Select the existing button you designed earlier on the screen.
- In the Assets panel, locate
Button / Primaryand drag an instance onto the screen. - Match its size and constraints by positioning it where the old button was.
- Delete the old button group/frame (the non-component version).
- Repeat for inputs, top bar, and icon buttons.
If you have multiple screens (Login, Forgot Password, Sign Up), replace each duplicate element with instances so changes stay consistent across screens.
Step 3: Use variant properties instead of duplicating layers
Instead of creating separate “disabled button” copies, select the button instance and switch:
StatetoDisabledfor loading/blocked statesSizetoS/M/Ldepending on layoutIcontoOn/Offif needed
Do the same for inputs (e.g., State=Error to show validation issues).
Organize components on the UI Kit page
Recommended layout
- Keep each component set (variant group) together in a grid.
- Label sections with simple text headings (e.g., “Buttons”).
- Place the most common variant first (e.g.,
Size=M,State=Default).
Keep the component set clean
- Don’t create separate component sets for every tiny change; prefer properties (
State,Size, toggles). - Keep layer names consistent across variants (e.g., always
Label, alwaysIcon). - Use the same property values everywhere (
DefaultnotNormal).
Common pitfalls (and how to avoid them)
Detaching instances to “quickly edit”
If you detach to change a label, you lose the link. Instead, expose text properties (Label/Title/Placeholder) so instances can change text safely.
Inconsistent layer names across variants
Variant property controls and swapping work best when layers are named consistently. If one variant uses Text and another uses Label, you’ll get confusing overrides and harder maintenance.
Too many component sets
Beginners often create separate components like “Button/Primary Hover”, “Button/Primary Disabled”, etc. Prefer a single component set with a State property so you can switch states from the instance panel.
Breaking auto layout when toggling icons
If your icon toggle leaves awkward spacing, ensure the icon is truly removed in the Off variant or that the layout collapses correctly. Test by switching Icon on/off on an instance.
Editing instances instead of the main component
If you find yourself fixing the same padding or corner radius in multiple places, you’re likely editing instances. Make the change on the main component so all instances update.