# Pattern: Combining Components Into Reusable User Solutions

> A pattern joins several components into one tested way to help someone finish a task, such as signing in. Here is how to spot, build, and adapt one.

**In short:** A pattern is a reusable solution to a common user problem, built by putting several components together in a set layout with set behavior so someone can finish one job.

From "Design systems", a free course by Venkat R. Murty: https://designervenkat.online/learn/design-systems/pattern

## What you will learn

By the end of this lesson, you will know what a pattern is in a design system, how it differs from a single component, and what a good pattern writes down. You will walk through one sign-in pattern step by step. You will also learn why a team should adapt a pattern with care instead of copying it blindly.

- **Component:** One reusable piece of a screen, such as a button, a text field, or a checkbox. It has one clear job.
- **Pattern:** A repeatable solution to one common user problem. It is made by combining several components in a set layout and set behavior.
- **Design system:** The shared set of parts, rules, and guides that a team uses to build products in a consistent way.
- **Anatomy:** The list of parts in a pattern and where each part sits, like a body diagram in words.
- **States:** The different conditions a pattern can be in, such as empty, loading, error, or success.
- **Accessibility:** Making a design usable by people with different abilities, including people who use a keyboard or a screen reader. A screen reader is software that reads the screen out loud.

## What is a pattern?

A pattern is a reusable solution to a common problem that users meet again and again. It is built by putting several components together in a set layout with set behavior, so a person can finish one job. Search, sign-in, and filtering are typical examples. A pattern describes how the pieces work together. It does not only describe how one piece looks.

- **One piece, one job:** A component is a single element, such as a button or a text field. It works on its own, and other designers can drop it into many screens.
- **Several pieces, one task:** A pattern uses several components at once. A sign-in pattern may use two fields, a main button, a link, and an error message. These parts sit in a set order and behave the same way each time.
- **Sits above the parts:** In the stack of a design system, patterns sit above components. Components are the parts, and a pattern shows how to arrange those parts to meet a user need.

A simple way to remember this: components are the ingredients, and a pattern is the recipe that tells you how to combine them for one meal. The design system is the cookbook plus the kitchen rules that keep every cook working the same way.

### Where do patterns sit among other parts?

A design system is built in layers. At the bottom are design tokens, which are named values such as a specific blue or a standard amount of space. Components are built from those tokens. Patterns are components put together into solutions. Guidelines, the written rules, hold the whole system together. This lesson does not teach tokens or single components, because other lessons in this course cover them. What matters here is that a pattern always rests on components.

## Why do teams use patterns?

Patterns help in two main ways. They make screens feel the same, and they save design time because a team can reuse a solution that already works.

- **Consistency:** When a user learns how sign-in works in one part of a product, the same steps work in the other parts too. That lowers confusion and mistakes.
- **Saved time:** A designer does not have to rebuild the same search flow for every new screen. Time can go to harder questions, such as what the user needs to see first.
- **Proven solutions:** A solution that real people have tested is more likely to work. OpenClassrooms, in its guide to Material Design, says that its patterns were tested with users and consider accessibility.

> **Tip:** Patterns save time only when they are written down clearly. A pattern with vague rules leads to several near-copies that drift apart, which is the very problem a pattern is meant to solve.

## What does a good pattern document?

A pattern is more than a picture of parts on a screen. A good pattern has a written page that tells the team what it is for and how to use it. Most pattern pages cover the topics below.

- **The problem:** Name the user problem the pattern solves, in plain words. For example: the user needs to get into an account.
- **When to use it, and when not to:** Say which situations call for the pattern and which do not. A search pattern helps people find content, so it may be the wrong tool for choosing one item from a short list.
- **Anatomy:** List the parts and where they sit, such as a label above a text field and a main button below it.
- **States and behavior:** Describe what the pattern does in each condition, such as empty, loading, error, and success.
- **Accessibility needs:** Explain how people who use a keyboard or a screen reader can still finish the task.
- **Variants:** Show the versions that exist.

### States and behavior

Users meet a pattern in many conditions, not only when everything goes right. A good pattern plans for each one, so the screen never leaves the user guessing.

- **Empty:** There is nothing to show yet, often because the user is new or has not saved anything. The screen should explain what to do next. Carbon lists empty states as a pattern of their own.
- **Loading:** The system needs time to finish. Show that work is happening, especially when the wait is long. Carbon describes its loading pattern for information that takes an extended time to appear.
- **Error:** The action failed, or the input is wrong. Material Design treats an error as a moment when an app fails to finish an action. Say what went wrong, place the message near the place the user must fix, and explain the fix.
- **Success:** The task finished. Confirm the result so the user knows they can move on.

### Accessibility needs

Accessibility means that people with different abilities can still use a design. A pattern should name its accessibility needs in its documentation. Otherwise each designer has to guess, and some will guess wrong.

> **Tip:** Check that a field's label and its placeholder do not say different things. The placeholder is the faint hint text inside an empty field.

## Worked example: a login pattern

Sign-in is one of the most common patterns. The plan for this lesson names Google and Airbnb as examples of a login with a text field, a password field with a show and hide toggle, a main button, a 'Forgot password?' link, and inline error messages. Inline means the message sits right beside the field it is about. I did not verify those products' login screens in my research, so the steps below use IBM's Carbon login pattern, which I read, to show how the same kinds of parts fit together.

1. **Start with the user problem:** The user needs to get into an account. Carbon describes its login page as the way a user gets access to an application by entering credentials or using another supported authentication method.
2. **Choose a layout:** Carbon offers a single-column form for a simple entry point, and a split-screen layout with the form on one side. In a split layout, any picture or marketing text must not distract from the form, because signing in is the main goal.
3. **Arrange the parts:** Place the user ID field and the password field first, then a main button. Add a recovery link, such as 'Forgot password?', near the form. Keep any sign-up link with the login content, not inside the marketing area.
4. **Define the behavior:** Offering to remember login details can also speed up the next sign-in.
5. **Plan each state:** If the password is wrong, show an inline error beside the password field, not only a message at the top. While the check runs, show a loading state on the button so the user knows the request is in progress. When it succeeds, move the user into the product.
6. **Write the rules down:** Record the problem, the layout choices, the parts, each state, and the accessibility needs. Now any team that builds a sign-in screen follows the same recipe.

> **Tip:** The colors and brand look can change from one product to another. The order of the parts, the placement of links, and the feedback should stay the same, because that is what makes the pattern feel familiar.

**Quick check:** A new budgeting app is designing its sign-in screen. The team places a large promotional image on the left, and on the right the form has a small Sign in button. The sign-up link sits inside the promotional area. Which change best follows the login pattern?

A. Make the promotional image larger so the brand feels stronger.
B. Keep the image, but make the form the main focus, and move the sign-up link next to the login form.
C. Remove the Sign in button and let users press Enter in the password field.
D. Show the sign-up link only after a user fails to sign in twice.

**Answer:** B. The login pattern treats signing in as the main goal. Visuals should support the form rather than compete with it, and the sign-up link belongs with the login content.

## How do you adapt patterns with care?

A pattern is a starting point, not a script. That freedom is useful, but use it carefully. Change a pattern only when real users show that it does not fit their task.

1. **Check real user behavior:** Look at what people do: where they get stuck, what they search for, and which steps they skip. A pattern should rest on this evidence, not on what looks attractive.
2. **Compare with the existing pattern:** Find the pattern in your system and read its rules. Ask whether your case has the same user problem that the pattern solves.
3. **Keep the core, change the detail:** Keep the parts and order that make the task work. You can adapt details such as wording, field length, or where an optional link sits.
4. **Test the change:** Try the adapted version with a small group of users and watch them finish the task. Note where they hesitate.
5. **Document or drop the change:** If the change helps, update the pattern page so the next team knows when to use the variant. If it does not help, do not publish it as the standard.

> **Tip:** Copying a pattern blindly can copy its problems too. A sign-in built for a bank may ask for more checks than a game app needs. Ask why each part exists before you keep it.

## Is it a pattern or a component?

A quick test helps you decide. If the thing is a single reusable element with one job, it is a component. If it combines several components to finish a user task, such as sign-in, search, or filtering, it is a pattern. Components tend to stay fixed in how they look and work, while a pattern sets out how to combine them for a task.

- **Ask about the job:** A single job points to a component. A whole task, with several steps or parts, points to a pattern.
- **Ask about the parts:** If the solution needs other components to work, it is probably a pattern.
- **Expect both:** A design system usually has components and patterns side by side. Patterns are built from components, so both are needed.

**Quick check:** Your team already has a text input, a button, and an icon component. Three designers have each built a different search bar for different screens. What should you create to fix this, and why is it a pattern rather than a new component?

A. A new search component with its own colors, sizes, and icon, so every search bar is one object.
B. A search pattern that uses the existing input, button, and icon in one set layout, with rules for placeholder text, results, and no-results messages. It is a pattern because it combines parts to solve one user task.
C. A new icon component for the search symbol, because the icon is the part that differs between the three bars.
D. Nothing yet. Let each designer keep their own bar, because each screen has different needs.

**Answer:** B. The parts already exist, so the fix is not a new part. The problem is how the parts are combined and how they behave, and a pattern records exactly that. Writing the search rules once lets every screen reuse them.

## Key takeaways

- **Patterns combine parts:** A pattern joins several components into a set layout and behavior for one common user task.
- **Document the whole:** Write down the problem, when to use it, the anatomy, the states, the behavior, and the accessibility needs.
- **Reuse with judgment:** Reuse proven patterns, but test and adapt them based on real user behavior instead of copying them blindly.

## Sources

- [Carbon Design System: Patterns overview](https://www.carbondesignsystem.com/building-blocks/core/patterns/overview)
- [Carbon Design System: Login pattern (preview page)](https://carbon-website-git-fork-theiliad-add-horizontal-bar-charts.carbon-design-system.vercel.app/patterns/login-pattern)
- [Carbon Design System: Login pattern page](https://www.carbondesignsystem.com/building-blocks/core/patterns/login)
- [Carbon Design System: Search pattern](https://v11.carbondesignsystem.com/patterns/search-pattern/)
- [Carbon Design System: Search usage guidance](https://v10.carbondesignsystem.com/components/search/usage/)
- [Carbon Design System: Forms pattern](https://carbondesignsystem.com/patterns/forms-pattern/)
- [Nielsen Norman Group: Design Systems 101](https://www.nngroup.com/articles/design-systems-101/)
- [Designsystems.surf: What are UI Patterns in Design Systems?](https://designsystems.surf/guides/pattern)
- [UXPin: Design System vs. Pattern Library vs. Style Guide vs. Component Library](https://www.uxpin.com/studio/blog/design-systems-vs-pattern-libraries-vs-style-guides-whats-difference/)
- [Superdesign: What Is a Design System? Parts, Examples, and How to Build One](https://superdesign.dev/blog/what-is-a-design-system)
- [ANML: Design system vs component library vs pattern library](https://www.anml.com/blog/design-system-vs-component-library-vs-pattern-library-what-s-the-difference)
- [Center Centre: Components Versus Patterns](https://articles.centercentre.com/components_vs_patterns/)
- [Wikipedia: Design system](https://en.wikipedia.org/wiki/Design_system)
- [Wikipedia: Design pattern](https://en.wikipedia.org/wiki/Design_pattern)
- [OpenClassrooms: Use Material Design as a reference](https://openclassrooms.com/us/courses/4556206-design-the-visual-side-of-experiences-ui-design/5259141-use-material-design-as-a-reference)
- [Google Material Design: Introduction](https://m2.material.io/design/introduction/)
