© Diana MacDonald 2019
Diana MacDonaldPractical UI Patterns for Design Systemshttps://doi.org/10.1007/978-1-4842-4938-3_1

1. Introducing UI patterns

Diana MacDonald1 
(1)
Victoria, VIC, Australia
 

To help you create intuitive products, this chapter will introduce UI patterns and highlight why they’re important and valuable.

What’s a UI pattern?

A pattern is a recurring solution to a problem in a context.

I like to think of patterns as models: a pattern has a structure and can be easily used to help you solve a problem faster than building from scratch. They have a consistent and recognizable form, as well as a method of being referenced, such as a memorable name. In knitting, you might choose a pattern from a book to help you make a sweater with good sleeves, noting that some sweaters are more ornamentally complex than others. In origami, you might use a folding pattern to produce a complex sculpture from basic origami folds, such as the orizuru (折鶴) or paper crane shown in Figure 1-1.
../images/481801_1_En_1_Chapter/481801_1_En_1_Fig1_HTML.jpg
Figure 1-1.

Photo of paper cranes by Rebecca Freeman

While you might create an orizuru using a proven solution, there are many ways to fold a paper crane with varying levels of ornamentation, like a flapping crane or consecutive cranes.

UI patterns (user interface patterns) are found in the digital sphere of web sites, applications, native mobile apps, and other software or devices. They provide a language for discussing interactive design. They suggest function, interaction, and intent. UI patterns document reusable parts of an interface that share a purpose.

To understand UI patterns (and how they differ from components), let’s explore some ideas from the UI framework, Bootstrap. First, we’ll look at the thumbnails component ( https://getbootstrap.com/docs/3.4/components/#thumbnails ) from version 3 of the framework, as shown in Figure 1-2, before circling back to what makes a UI pattern.
../images/481801_1_En_1_Chapter/481801_1_En_1_Fig2_HTML.jpg
Figure 1-2.

Screenshot of Bootstrap 3’s thumbnails component default example

The thumbnails pattern presents small image previews in a collection where each image is linked to a larger resource, such as a high-resolution version of the image. If the thumbnail is a preview of a product, it will link to the product detail page. If it is a thumbnail of a video, it will link to the video player to watch the video. The key features of the thumbnails pattern are as follows:
  • Small images.

  • Linked resources.

  • It represents a collection.

You’ll frequently find images in this pattern shown alongside a title or description, as shown in Figure 1-3.
../images/481801_1_En_1_Chapter/481801_1_En_1_Fig3_HTML.jpg
Figure 1-3.

Screenshot of Bootstrap 3’s thumbnails component with custom content

In Bootstrap 4, however, you’ll find that this component’s been replaced by the card component ( https://getbootstrap.com/docs/4.3/components/card/ ) using an image, title, text, and link, as shown in Figure 1-4.
../images/481801_1_En_1_Chapter/481801_1_En_1_Fig4_HTML.jpg
Figure 1-4.

Screenshot of Bootstrap 4’s card component

This change more clearly separates the thumbnail’s purpose of previewing visual content—a content pattern—from the card layout’s purpose of segmenting content using repeating containers for images and text—a display pattern. The shift toward the display pattern makes sense for a flexible UI framework with built components. We’ll learn more about components in Chapter 4.

UI patterns are more abstract than visual style. While patterns can often be identified by visual similarity, these components demonstrate it’s not always so easy: a pattern describes behavior, which can be divorced from easily identifiable visual presentation. You can, for example, apply a strong, dramatic visual style or a subtle, muted flavor to a thumbnail collection.

Note

You might also see reference to user flow patterns or strategic patterns when a UI pattern spans multiple pages, like in the lazy signup pattern in Chapter 2. Similarly, you might read about behavioral patterns, persuasive patterns, or social patterns, where the characteristic behavior presents information, shares a message, or persuades a human, like in the good defaults pattern in Chapter 2.

Elements of a UI pattern

A UI pattern is defined by three ingredients:
  • A named solution describing what the pattern does

  • The problem the user is facing or why this pattern is needed

  • The context for when to use the pattern

For our thumbnail example
  • The named solution “thumbnails” suggests a collection of small image previews linked to larger resources.

  • The user’s problem is navigating a large collection of content and selecting only the items they want.

  • The context is when the user needs a preview before deciding—before downloading a large file or committing to watching an entire movie. You’ll often find thumbnails on product range pages or search result listings before you’ve decided which item to drill in on. In contrast, product or detail pages need fewer thumbnails because that product or item is what you came to see so they can be shown in full without a thumbnail.

As you can see in Figure 1-5, Pinterest uses thumbnails in their visual discovery product.
../images/481801_1_En_1_Chapter/481801_1_En_1_Fig5_HTML.jpg
Figure 1-5.

Screenshot of Pinterest thumbnails

If Pinterest continuously loaded high-resolution images at their full size instead of thumbnails, that would slow down an otherwise immersive experience. Pinterest needs to present thumbnails to facilitate smooth browsing to help people discover ideas.

In a large collection like that, you won’t know what image will appear next or if it’s something you want to see in detail. By using thumbnails, you can quickly browse a larger set of choices before zooming in on particularly interesting items.

Figure 1-6 shows an Adidas product with thumbnails.
../images/481801_1_En_1_Chapter/481801_1_En_1_Fig6_HTML.jpg
Figure 1-6.

Screenshot of Adidas’s product images with thumbnails

Each small image (thumbnail) in this collection shows a preview of a product photo, linking to a larger photo. Unlike the Pinterest example, here the thumbnails are presented at the same time as the linked item. The selected thumbnail is indicated by different styling (black borders above and below), while the larger photo is shown.

Warby Parker glasses, on the other hand, need no thumbnails to flick between product images, as shown in Figure 1-7.
../images/481801_1_En_1_Chapter/481801_1_En_1_Fig7_HTML.jpg
Figure 1-7.

Screenshot of Warby Parker’s product images with no thumbnails

These images are the main subject of the page. There are fewer images to browse than most thumbnail collections (just three photos), so smaller previews would not save you much time. You can also predict what the next photo will be: the same glasses from another angle. You might as well jump straight to it than fill up the page with tiny thumbnails. This is an example of when you don’t need thumbnails.

Other pattern details

When describing a UI pattern, some people also specify these details:
  • Why?
    • Explanation of how it solves the problem

    • Supporting principles, such as usability principles

    • User research and other evidence

    • Motivation

  • Examples

  • How it works

  • Consequences
    • Trade-offs and drawbacks

    • Result context and expected improvements

  • Implementation details

  • Sample code or design assets

  • Known uses “in the wild”

  • Author or resident expert

  • Related patterns

  • Alternative names or aliases

  • Links to more resources

These tend to be used to elaborate on the three main components—solution, problem, and context. Particularly—and importantly—it is common to suggest alternative, related patterns of interest in the context part of a pattern to clarify when not to use the pattern. I note these here so you may recognize them when you see them elsewhere and can consider them for yourself if you find yourself writing a pattern.

A specific collection of patterns for a project is often called a pattern library . Pattern libraries give teams a common language to improve their design processes. We’ll discuss pattern libraries further in Chapter 4.

Why care about patterns?

UI patterns compare approaches, distilling the considerations and successes of designers before you. Knowing the patterns and understanding the decisions that went into them let you take advantage of the mounting wisdom of whole generations and industries that brought about these patterns, without reinventing the wheel. The small, reusable UI solutions found in these patterns can then be composed together to build cohesive, intuitive experiences that resonate with people.

Let’s look at some of the other benefits of learning UI patterns.

Design efficiently

Knowing patterns can help you design efficiently by quickly recognizing the best tool for the job, understanding the value of different solutions, and solving the largest number of problems at once. For example, an autocomplete search box might help your site visitors navigate your site content, recognize the term they’re looking for without knowing the exact name or spelling, and select a result after only typing a few characters without needing to waste energy typing in the full search term. By learning about the autocomplete UI pattern, you’ll more quickly recognize when you need to use it, and likewise with all UI patterns. For example, if you need to redesign the navigation for a catalog of products by expanding the existing horizontal dropdown menu into a multilevel one, you can see how an autocomplete search box might solve the problem better. We’ll look at autocomplete again in Chapter 3.

You can even recognize patterns across evolving technology. Compare the hated “Clippy” ( www.theatlantic.com/technology/archive/2015/06/clippy-the-microsoft-office-assistant-is-the-patriarchys-fault/396653/ ) Microsoft Office assistant to Slack’s chatbot called Slackbot, shown in Figure 1-8.
../images/481801_1_En_1_Chapter/481801_1_En_1_Fig8_HTML.jpg
Figure 1-8.

Screenshot of Slackbot introducing itself

As conversational UIs have developed, we’ve seen some drastic changes in how we interact with technology; however, we’ve also noticed some similarities. You can see some familiar patterns, including identity and profile information, private chat, and feed updates. Increasing your familiarity with diverse patterns will help you efficiently solve design problems you face in new user interfaces, especially if you understand the underlying usability principles and can adapt patterns to new contexts.

Consistency and familiarity

Using familiar patterns lets you foster predictability. The familiar idea of drag and drop lets you directly manipulate an object by dragging and dropping it. A common use of drag and drop is to upload an image by dragging it from your computer’s local file system to a target drop area in the interface. Most to-do apps let you drag and drop to-do items to reorder them or move them to different lists. The more pervasive drag and drop interfaces become across the Web, the more likely people will understand how to interact with them. GitHub, for example, makes it clear that you can attach a file to a comment and that you can do this using several methods (drag and drop, select, paste). In Figure 1-9, you can see GitHub’s rich text editor for comments that lets you drag and drop images.
../images/481801_1_En_1_Chapter/481801_1_En_1_Fig9_HTML.jpg
Figure 1-9.

Screenshot of GitHub’s rich text editor for comments

A text description is provided that hints at the drag behavior. Once you start dragging a file to the comment area, it is highlighted in green to reveal the drop target area, as shown in Figure 1-10.
../images/481801_1_En_1_Chapter/481801_1_En_1_Fig10_HTML.jpg
Figure 1-10.

Screenshot of GitHub’s drag and drop shows the image filename and highlights the drop target area in green

Consistent use of patterns within a web site will help visitors build a mental model of how stuff works. If you can drag and drop files to this comment, maybe you can do that elsewhere. Sure enough, you can attach files to Pull Requests and Reviews as well, as shown in Figure 1-11.
../images/481801_1_En_1_Chapter/481801_1_En_1_Fig11_HTML.jpg
Figure 1-11.

Screenshot of GitHub’s drag and drop on a Pull Request

You can use consistency to set your visitors’ expectations about how your web site works, so they may quickly learn a new area or more advanced tool by building on what they’ve learned already about your site.

Consistency and reuse

By their recurring nature, patterns let you reuse design solutions both visually and within code. Visual repetition lets you build consistency and predictability into your interfaces, creating a learnable experience for your users. Reusability in code also saves time, letting you refactor and improve existing features instead of rebuilding new features every time (even when something similar exists already). A pattern incorporates many design decisions to solve a problem, while programming encodes those decisions; patterns ensure you Don’t Repeat Yourself (DRY), making each design decision only once. If the 548 unique colors and 261 declarations of Facebook blue ( www.lukew.com/ff/entry.asp?1469 ) have taught us anything, it’s to maximize reuse by minimizing inconsistency.

Communicating decisions

As a communication tool, patterns let designers persuade stakeholders and colleagues of the value of a solution. You can describe why your solution is the best for a given context. You know the purpose of a pattern, how it meets the users’ needs, the similar alternatives available, and how to implement it for your brand.

Design patterns let you reference existing proven solutions, which means you have support for your decisions. Agency designers working with skeptical clients and in-house designers facing internal deadlocks sometimes need to defend specific approaches or resolve roadblocks. In these scenarios it might be useful to show how Apple use this pattern to help customers connect with customer support or Amazon used that pattern to improve conversions. This shows a concrete, tangible example of the pattern executed in the real world and helps stakeholders and colleagues visualize the desired result.

Even better than competitive contrasts, patterns can be backed by user research. Use analytics, A/B testing, user testing, customer support feedback, and survey info to show evidence for decisions. For example, “we tested this with a sample of our most engaged customers and the research shows that given the age and expertise of our visitors, the dashboard pattern works better than table filters for directing attention to desired metrics.”

Further, a well-documented pattern clearly describes the user needs it meets and how it achieves that, giving you ready-made reasons to share with your stakeholders. Referring to the strengths of a pattern and consistently using patterns can relieve some of the pain points of design by committee ( www.w3.org/People/Bos/DesignGuide/committee.html ) where many people provide design input without a cohesive vision or process to resolve details, producing lower-quality work. Figure 1-12 shows a well-documented Alerts pattern.
../images/481801_1_En_1_Chapter/481801_1_En_1_Fig12_HTML.png
Figure 1-12.

Screenshot of U.S. Web Design Standards shows when to use Alerts components and when to consider something else

Communicating within teams and tools

There’s the joke that there are only two hard problems in computer science ( https://martinfowler.com/bliki/TwoHardThings.html ): cache invalidation and naming things. The joke exists because clarity through language is challenging. Evocative names speed up discussion, increase clarity, avoid mistakes, and make the underlying ideas easier to talk about. Using standard names for patterns helps designers and developers especially with talking to each other. “We might use an ‘accordion menu’.” “Let’s test ‘infinite scrolling’ instead of ‘pagination’.” For developers, it might help to consider that CSS classes are patterns. Your BEM (Block, Element, Modifier) names (if you follow that convention) should describe your patterns, how they’re used, and how variants are used. Similarly, increasing the use of CSS or Sass variables ( https://css-tricks.com/sass-style-guide/#article-header-id-17 ) in your code should clarify the intent, making it easier to understand the relationships between objects ( https://thoughtbot.com/blog/sass-variables ). Figure 1-13 shows a “badge” pattern visually and in code.
../images/481801_1_En_1_Chapter/481801_1_En_1_Fig13_HTML.jpg
Figure 1-13.

Screenshot of MailChimp badge pattern indicates badges appear inline to provide additional context

Note

It’s worth noting that even though one benefit of patterns is that they provide a shared vocabulary for people working together across a business (including designers, developers, marketers, customers, and so on), each person interprets terms using their own background and experience, which can sometimes lead to confusion. What a marketer might call a tracking pixel or tag, a developer might call a third-party script. What a developer might call letter spacing, a designer might call tracking. What a designer might call a pixel… you see where I’m going.

In UI patterns, an autocomplete pattern might be conflated with an autosuggest pattern or described only as a “search box” or “dropdown.” These discrepancies cause confusion when talking about patterns. To work around this, you’ll find some patterns in this book include alternative names, with the most prominent or unambiguous name listed first. Generally, pattern names are more useful when they describe the solution, for example, “good defaults,” instead of the problem, for example, “blank slate.” We’ll look more at pattern libraries as style guides and communication tools in Chapter 4.

Evidence-based solutions

As patterns are recurring solutions, they are only developed through repeated, successful use: if it didn’t work, we shouldn’t repeat it. Patterns gather up best practices and principles refined by previous designers but can also be compared with other solutions and tested with users. Patterns are also framed in terms of how they solve a problem. In contrast, a design principle like “give users control” is vague about how this solves problems for users. Extending our earlier thumbnail example, you can see how a collection of tiny, compressed images would be faster to download than all the high-resolution resources, so the preview collection could be perused in less time. If your images download faster, your users might stay longer. You could review your site analytics to see if their time spent on site is longer when you use thumbnails. This kind of evidence validates the success of the solution. With evidence, more people end up using the solution. This is how solutions become patterns.

You can use patterns to fast-track improvements by exploring how designers have used them before. We’ll look at resources for patterns in Chapter 2.

Context-specific, tailored solutions

Patterns are context-specific. Essentially they are tailored to the precise problem. This makes them more useful than design principles ( www.interaction-design.org/literature/topics/design-principles ), which are excellent theories to fall back on if you need to develop a solution from scratch but are far less practical than patterns.

Content contributors without a web design background

Relying on patterns lets content contributors who are unfamiliar with the practice of web design use smart defaults. You don’t always need to understand the details under the hood to get value out of existing patterns and can skip the pain of finding out the hard way that rolling your own from scratch means a lot of hard work. You can continue to specialize in your own area without sinking too much time into details.

Additionally, patterns formed by diverse contributors may be more effective and robust than, say, patterns only made by developers. More on that in Chapter 4.

Learning from the experts

Patterns let you leave the details of UI solutions to the experts in some cases and provide excellent learning material in others.

For example, by using a search filter pattern, you might be reminded to include a cancellation option to clear the filters to return to an unfiltered search, whereas designing and building search filters without reference to the pattern might leave you slowly figuring out these kinds of details one by one. Patterns let you accelerate design and development processes.

By using a standard solution, you’ll be able to chat about it easily with expert communities like Stack Exchange’s Stack Overflow ( https://stackoverflow.com/ ) or User Experience ( https://ux.stackexchange.com/ ) Q&A communities. There’s also a good chance there are resources available that show patterns in action, sometimes demonstrating additional considerations. Let’s consider some examples:
  • Development frameworks like Bootstrap have already considered accessibility details like role="tablist" aria- multiselectable="true".

  • The Devise ( https://github.com/plataformatec/devise ) authentication solution for account registration and sign in has already considered user flow patterns like email confirmation tokens, revealing valid usernames, and more.

  • Payment companies like Stripe ( https://stripe.com/ ) have already considered how to balance usability and security.

In each of these cases, you can either incorporate the expert’s approach into your own or dig into it further. This helps if you trust that the pattern has been executed well, but there are anti-patterns to look out for, which we’ll see in Chapter 5.

Learning how to improve experiences from patterns

Patterns are a fantastic learning tool. They demonstrate reusable components that have been proven and battle-tested—you can find real examples on live sites. Patterns describe the user need that prompted its existence in the first place, for example: “Our customers are nervous about financial decisions because money is a massive stressor, so let’s use reassuring words in our inline help hints, as well as live previews and confirmation patterns to improve their confidence.”

They document the decisions that have been made by other designers before you. They show you the forces or factors you need to consider in your design decisions—how many size variants do we need? Contextual colors? Should alert messages be dismissable? What’s the difference between a link with a button style and a button with a link style?

We’ll look more at learning through patterns in Chapter 2.

Summary

A UI pattern is a recurring digital solution to a problem, in a given context. Learning and using patterns can help you
  • Efficiently solve design problems across evolving interfaces as technology changes

  • Produce intuitive products through consistency and familiarity

  • Save time instead of repeating yourself

  • Communicate design decisions

  • Communicate within teams to solve problems

  • Find evidence to support a solution

  • Use tailored solutions for a context

  • Use smart defaults without extensive product design experience

  • Stand on the shoulders of giants

  • Learn how to improve a user’s experience

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.192.3