跪拜 Guibai
← Back to the summary

Stop Saying "Less AI Slop": UI Lab Gives You Concrete Before/After Design Cases

UI Lab has a color case study that uses a "Monthly Miles This Month" card to show a before/after comparison. The large text says the monthly cumulative mileage is 268 km, and the small text below adds "42 km more than last month."

A glance tells you how far you've walked this month. Only on a second look do you learn how much more than last month. The problem lies in that second look. The small text uses gray on a deep blue background, making it hard to read.

I just changed that line to light blue. 268 km is still the first number you see, and when you want to read the line below, you can now see it clearly.

I like these kinds of examples you can put side by side. Because when you're changing a page, this is often the hardest thing to explain. You can tell Codex to "push the hierarchy apart more," but is the main value too weak, or is the explanatory text already too weak?

I built an interactive case library called UI Lab specifically to experiment with these small problems. It currently contains 401 cases across 12 sources.

Try UI Lab online · GitHub repository

Why build UI Lab

UI Lab stands for UI Laboratory. UI is User Interface. Lab is short for Laboratory.

I wanted to build this lab because there's an easy step to skip between reading design books and changing an interface.

Books talk about establishing visual hierarchy. Reading that, I think I understand. But when I'm facing a card with a value, a unit, and a supplementary note, just knowing that sentence still means I have to experiment to see which spot needs changing.

So I turned some of the practices from "Refactoring UI" and "The Non-Designer's Design Book" into code. The same content is shown in two versions, and you can click to see where the change happens. When you understand, try it on your own page.

This also solves another problem I had when using Codex to change interfaces. Instead of just saying "less AI flavor," I prefer to point out exactly what's in the way. Cards lined up that are all too loud, or a settings panel with a background that's too busy, making the explanatory text hard to read. Giving a comparable case and telling it how to accept the change makes the conversation much easier.

What cases get accepted

I mainly pick from classic design books and well-followed design Skills, component libraries, and motion projects on GitHub. Whether a book's principle is suitable for experimentation, and whether an open-source project's example is worth pulling out, I decide case by case.

First I find the original book chapter, or compare against official examples, documentation, and source code. If the source is findable, readers can go back to see the context. Then I look at what's worth manipulating in the example. If the same animation only changes color and size, making it a control in one demonstration and toggling back and forth is enough.

There's another thing I care about myself. After the reader closes the demo, what can they take away?

The best outcome is a practice they can try in their own page. For example, with explanatory text on a colored background, measure the contrast before changing the color, and measure again after. For sources like shadcn/ui that have official components and examples, I try to preserve the original states and interactions, walk through them, and see what the reader can observe after opening. See UI Lab case curation rules

What problem does it solve

When you actually get down to changing a page, you might only have a sentence like "the whole page jumps when it finishes loading." At that point, trying to remember which book, which chapter talked about this is difficult.

So UI Lab lets you search for the problem you see. The search results include the source and chapter, and clicking in lets you interact with it. A static image can't show whether a container changes height in a skeleton screen swap, nor whether a payment completion leaves enough time for you to recognize the result. These details are only visible when they move.

Once you see it clearly, you can send the reference link, design points, and acceptance criteria together to a colleague or an agent. Everyone is referring to the same interaction and the same result, so the discussion becomes much more concrete.

Project highlights

When making before/after comparisons, I try to keep the same content. The monthly cumulative mileage and last month's comparison stay in their original spots. When your eyes go back and forth, your attention naturally falls on the line of explanatory text whose color was changed.

Some examples carry their value in the original interactions. For cases like UI Skills Playbook and Stageshow, I preserve the upstream interaction. For scenarios that need timing, like a payment flow, you can slow it down in the player.

Each case has its own link. If you want to send it to a colleague mid-way, copy the current address. Switching to English keeps you on the same case.

Core feature showcase

1. Browse cases by source and chapter

If you want to follow the book's order, open "Refactoring UI" from the home page and go through chapters one by one. If you want to know which sources are in the library, the sitemap puts them all on one page. Open the sitemap

UI Lab sitemap lists each source and the number of cases, with sources expandable for chapter-by-chapter browsing

2. Search across projects from a problem

Browsing the table of contents works when you have a book in mind. When you already have a specific problem, I usually press ⌘K, or Ctrl+K on Windows or Linux. There's also a search button in the header.

Type "loading" and the same search finds skeleton screens from UI Skills Playbook, a revised loading indicator from Kill AI Slop, and loading animations from loading.dev. The results list each one's source and chapter. If the page jumps on load, go look at the skeleton screen first. If the waiting prompt is hard to recognize, check the loading indicator.

UI Lab search for "loading," results come from multiple sources including UI Skills Playbook, Kill AI Slop, and loading.dev

In the screen recording, I open search from the home page, type "loading," and click into "Make the skeleton match the post-load layout."

Cross-project search demo: press the shortcut to open search, type loading, and click a result to enter a skeleton screen case

3. See the before/after, then try changing one thing

The monthly mileage card at the start comes from the text color case in "Refactoring UI."

In "Don't use gray text on colored backgrounds" from Refactoring UI, press "Play" or drag the progress bar, and you'll see the explanatory text on the left change from gray to light blue. The contrast between text and background rises from about 2.7:1 to 6.5:1, while the white main value stays most prominent.

Colored background text color demo: the note on the left mileage card changes from gray to light blue

If you also have a dark card, pick a line of supplementary text to try. After changing the color, read that line first, then scan the whole card to see if the hierarchy still holds. Try colored background text color

4. See how official components display attachment and upload states

When I look at shadcn/ui's Attachment, I first find the file that's still uploading. Three images are recognizable from their thumbnails. Scrolling down, the PDF row has a spinner and "Uploading · 64%". The next row is a TypeScript file showing its type and size.

shadcn/ui Attachment demo showing image thumbnails, a PDF uploading state, and a TypeScript attachment

The 64% here is a fixed example value, and the cancel and remove buttons are disabled. It's suited for thinking about one concrete thing: when several types of files are hanging in a chat box, can the user tell at a glance which one hasn't finished uploading? Try Attachment

5. Use rounded corners and background colors to separate the layers of a settings panel

Next, look at Kill AI Slop's team notification panel. On the left, the background is a gradient with a frosted layer on top, and the panel corners have a 25-pixel radius. On the right, the background is a solid color and the corner radius is smaller. Both sides do exactly the same thing: read a note and check "Receive notifications."

Quick settings panel redesign demo transitioning from a large-radius frosted panel to a small-radius solid panel

Is frosted glass appropriate here? Look at both versions and the feeling becomes concrete. Notice when your eyes find the checkbox and when they're still looking at the background. Try the rounded corner and surface comparison

6. Keep chart cursor and key numbers in sync

Numbers can also help someone search less. In Stageshow's Chart scrub, as the cursor moves along the revenue line chart, a reference line follows, and a dot sticks to the curve. The number at the top of the card switches accordingly, showing the revenue for the day nearest the cursor. When the cursor leaves, the top returns to the 14-day total revenue.

Revenue chart demo: reference line and data point follow the cursor, and the top amount toggles between daily revenue and total revenue

I like keeping the reading at the top. Your eyes know where to find the number, and no tooltip blocks the line. On your own dashboard, you can specifically check whether the top reading corresponds to a real day when the cursor passes between two days. Try Chart scrub

7. Use pauses to lay out a payment flow

Stageshow also has a payment flow that I think is worth watching in slow motion.

It first lets the balance and payment list appear, leaving a bit of time for you to recognize which money this is. Then the list moves aside and the instant payment panel comes in, with a connecting line tying it to the corresponding record. After sending completes, the list record also changes from "Pending" to "Paid."

Payment flow demo showing balance, payment records, connecting line, sending, and payment completion states in sequence

Each pause gives people time. When the balance first appears you can read the amount, after the card moves away you can find the corresponding record, and after completion there's a moment to confirm the result. Try Payout flow

8. Turn cases into tasks an Agent can execute

When you see a suitable case, switch to the "Prompt" tab and copy the Markdown in one click. It includes the case link, source chapter, number, design points, and acceptance criteria.

Case prompt includes the design task, case number, direct link, and acceptance criteria

Take an upload list, for example. I'll give Codex the current page's code or screenshot and the case prompt, then add, "On upload failure, it should be possible to retry on the same line; after success, update the status in place."

After the change, simulate a failure once. The entry point is findable, clicking continues, and the result stays in place. All of this can be checked on the spot.

If you frequently need these kinds of cases, you can install UI Lab's Skill in your target project. Tell the Agent where the problem is, what the user is doing, and which state is stuck, and it can go find the corresponding case. See the Skill documentation

npx skills add wangruofeng/ui-lab --skill ui-lab-ui-improvement

To wrap up

Go back to that monthly mileage card. First look at the monthly cumulative mileage, second look at how much more than last month. After changing the color, both steps are smooth.

A large part of what I call aesthetics lives in places like this. When making a page, you always have to decide what should stand out, what can be quiet, and what information must wait until the user has seen it clearly. Turning these choices into cases you can watch repeatedly gives me more confidence when I work on an interface.

If one day you, too, fix a detail that was hard to explain as "something feels off," UI Lab has done its job.

UI Lab is an open-source project with original code under the MIT license. You're welcome to go to the site and pick cases to use, and to get the source from GitHub and build on it for your own needs. For third-party examples or material cited, check the corresponding license notes in the repository.

If you find a case that isn't clear enough, or have a design detail worth making a demo of, you're welcome to open an Issue or submit a PR on GitHub. Open UI Lab site · View GitHub source