← LibraryDesign

Refactoring UI

Adam Wathan and Steve Schoger
≈ From memory

UI design is a systems engineering problem where scalability, consistency, and maintainability are achieved by treating visual elements as refactorable components powered by a foundation of design tokens.

Open Library

In one sentence

To build scalable products, you must stop designing "screens" and start architecting "systems" by decomposing UI into granular, tokenized components that can be audited, refactored, and reused.

Why read this (and who it's for)

This book is for the designer who feels overwhelmed by the sheer volume of screens in a growing product—the designer who finds themselves redesigning the same button style five different ways because there isn't a "source of truth."

It solves the Scale Problem: how to ensure that a design remains coherent when it grows from three screens to three hundred. After reading this, you will move from being a "pixel pusher" (someone who creates unique layouts) to a "Systems Architect" (someone who builds the vocabulary and grammar of an interface). You will learn how to audit your existing UI, extract its DNA into tokens, and build a library that actually survives the chaos of real-world production.

The big idea

The authors argue that most UI design fails not because designers lack aesthetic talent, but because they treat design as a linear process (Screen A $\rightarrow$ Screen B $\rightarrow$ Screen C) rather than a systemic process. When you design linearly, every new screen introduces the risk of inconsistency. If you change a brand color or a border radius on one screen, you have to manually find and update every other screen. This is "Technical Debt" in the world of design.

The solution is Refactoring. In software engineering, refactoring means restructuring existing code without changing its external behavior—making it cleaner, more efficient, and easier to maintain. Wathan and Schoger argue that UI design must undergo this same transformation. You must decompose your UI into its smallest constituent parts (Tokens), assemble those into building blocks (Components), and organize those into behaviors (Patterns).

By shifting the focus from the output (the screen) to the input (the system), you create a "Design Language." When the system is robust, adding a new screen becomes an act of composition rather than creation. You aren't inventing a new button; you are selecting a pre-existing component and configuring it with existing tokens. This allows for massive scale because the "rules" of the UI are baked into the foundation, not repeated on every page.

Key ideas

Design Tokens: The DNA of the System

What it is — Design tokens are the smallest atoms of meaning in a design system. They are the primitive values—like colors, spacing, typography, and shadows—abstracted away from their specific usage (e.g., instead of blue-500, you use color-action-primary). Why it matters — Tokens allow for instantaneous global changes. If your brand moves from "Electric Blue" to "Deep Teal," you change one token value, and the entire system updates automatically. It removes the ambiguity of "what blue are we using here?" In the book — The authors illustrate this by showing how a hard-coded hex code is a "dead end." They advocate for a naming convention that describes intent (how it's used) rather than appearance (how it looks), ensuring that when a designer chooses a token, they are choosing a role within the system.

Componentization and Hierarchy

What it is — This is the process of breaking down UI into reusable building blocks based on their responsibility. It follows a hierarchy: Atoms (buttons, inputs), Molecules (search bars, cards), and Organisms (navigation headers, feed items). Why it matters — It prevents "Design Bloat." When you build a component once, you ensure that every instance of that component behaves identically. It also allows for "Single Source of Truth" updates: fix a bug in the button component once, and it's fixed everywhere. In the book — The authors walk through the evolution of a UI element from a one-off design to a standardized component. They emphasize that a component is only useful if it is reusable. If you only use a component once, it’s not a component; it’s just a messy layout.

Consistency vs. Flexibility (The Tension)

What it is — A perfect system provides total consistency, but a perfect product requires flexibility to solve unique user problems. The goal of Refactoring UI is to find the "sweet spot" where the system provides enough constraints to ensure coherence while allowing for enough variance to satisfy specific needs. Why it matters — If your system is too rigid, designers will "break" it by creating one-off exceptions that don't follow the rules. If it’s too loose, the product becomes a fragmented mess of different styles. In the book — The authors discuss how to handle "edge cases." They suggest that when a unique requirement arises, you shouldn't just make an exception; you should evaluate if that requirement signals a need for a new component or a new variant in the existing system.

Documentation as an Interface

What it is — Documentation isn't a manual you write at the end of a project; it is the interface through which other designers and developers interact with your system. Why it matters — A design system is useless if people can't find what they need or don't understand how to use it. Good documentation reduces friction, prevents "rogue" designs, and ensures that the system scales without constant Slack messages asking "how do I do X?" In the book — They argue for "living documentation." This means moving away from static PDFs and toward interactive guides (like Storybook or Figma files) where the documentation lives alongside the actual components.

Accessibility as a Constraint, Not a Checklist

What it is — Accessibility should be baked into the tokens and components from day one, rather than being an audit performed at the end of the design cycle. Why it matters — Retrofitting accessibility is expensive and often results in "ugly" fixes. By making accessibility a core constraint (e.g., ensuring all tokens meet contrast ratios), you ensure that every component produced by the system is accessible by default. In the book — The authors show how certain design decisions—like color choice or touch target size—are actually accessibility decisions in disguise. They argue for "Inclusive Design" where the system's ruleset enforces these standards automatically.

Frameworks & tools

The Tokenization Workflow

Use this to move from a messy UI to a structured system:

  1. Audit: Take an existing screen and identify every unique value (color, font size, spacing).
  2. Categorize: Group these values by type (e.g., "Spacing," "Elevation").
  3. Abstract: Rename the values based on intent. Instead of radius-8, use radius-button.
  4. Map: Create a master list of these tokens. This is your "Source of Truth."
  5. Implement: Replace all hard-coded values in your design files with these tokens.

The Component Evolution Cycle

When you encounter a new UI requirement, follow this loop:

  1. Discovery: Identify the specific user need (e.g., "I need to show a progress bar").
  2. Prototype: Design the best solution for that specific screen without worrying about the system yet.
  3. Refactor: Look at the prototype. Can it be broken down into existing components? If not, what new building blocks are needed?
  4. Standardize: Once the design is approved, "refactor" it into the library. Create the component, document its variants, and publish it.
  5. Iterate: Every time you use that component again, you are now composing, not creating.

Memorable examples & stories

Key quotes

How to apply it

This week

  1. Audit one screen: Take a single complex screen in your current project. List every unique color, font size, and spacing value used on that screen.
  2. Identify "The Orphans": Look at those values. Which ones are used only once? Which ones are repeated?
  3. Create a Mini-Token Map: Create a simple spreadsheet or Notion page listing the 10 most common colors and spacings from that audit. Give them names based on intent (e.g., surface-primary, text-body).

Ongoing

Common pitfalls

Connects to

If you remember only three things

Internalize it

Fidelity note

I have high confidence in the core concepts of this summary, specifically the distinction between Tokens vs. Components, the Refactoring workflow, and the Intent-based naming convention. These are the pillars of Wathan and Schoger's argument. I am slightly less certain on specific minor anecdotes (like specific "button" evolutions) as these can vary depending on which version of their portfolio/case studies is being referenced, but the methodology remains consistent.

Keep going — related reads