๐Ÿ“Š We use cookies & analytics to improve your experience. Learn more
Latest

UI/UX Design Fundamentals Module 3 ยท Lesson 7 of 15

0% Exit to course

Module 3 ยท Components and prototypes Lesson 7 of 15

Components and variants

Learning objective

A component is a design element with rules: a button with states, an input with an error state. Building it once means the tenth screen costs minutes, not hours.

The concept

A component is a piece of interface you reuse: a button, a job card, a form field. A variant is that component in its different states โ€” default, hover, disabled, loading, error. Building the states as variants is what stops a design falling apart the first time something goes wrong in the interface.

In Figma, make a component, then add properties to it (size, state, icon) and use instances everywhere. When you change the component, every instance updates โ€” which is how a forty-screen portfolio stays consistent after the first week.

HTML
<button class="btn btn--primary">Apply now</button>
<button class="btn btn--primary" disabled>Apply now</button>
<button class="btn btn--primary is-loading" aria-busy="true">Sending...</button>

<!-- Build every STATE as a variant:
     default . hover . focus . disabled . loading . error -->

Common mistakes

The mistake is a separate hand-drawn button on every screen, so the corner radius changes by a pixel here and there and the final product looks almost designed. The second mistake is designing only the default state: no hover on a button, no disabled look, no empty state for a list โ€” and interviewers look for exactly those.

Worked example

One button component with primary, secondary, disabled and loading variants replaces every hand-drawn button in the file โ€” and keeps them consistent automatically.

Your practice task

Build five components with their states, then rebuild one screen using only those components.

Do this before moving on. Reading a solution teaches the shape of it; typing it teaches you.

Key takeaway

A component is a piece of interface you reuse: a button, a job card, a form field.

Create free account or sign in

Almost there

15 lessons left of 15

Finish every lesson to unlock the certificate. Each one ends in a practice task โ€” do them and the final project brief writes itself.