Single logo
  • Courses
  • Blog
  • About
Join on SkoolJoin on Skool

In this topic

React
  • One Request, Two Answers: the Same Post as an HTML Page and as JSON
  • A Blog Design from a Prompt: Downloading Figma Make Code and Reading App.tsx and BlogCard.tsx
  • How a Web Page Works: HTML Tags, Elements and Attributes
  • Semantic HTML: header, nav, main, aside and footer as Page Landmarks
  • HTML Forms: Labels, Names, Input Types and Where the Data Goes (GET vs POST)
  • CSS Basics: Selectors, Which Rule Wins, and the Box Model
  • CSS Flexbox vs Grid: A Nav Bar, a Card Row and a Dashboard
  • Responsive CSS: Viewport, Mobile-First Media Queries, clamp() and Dark Mode with Tokens
  • JavaScript for People Who Already Code: Syntax, Modules and Five Surprises
  • JavaScript Arrays the Functional Way: map, filter, reduce, find, sort and Object.entries
  • Async JavaScript: Promises, async/await, fetch and Promise.all
  • JavaScript in the Page: the DOM, querySelector and Events
  • npm, package.json and Vite: What npm install Fetches and How Vite Serves and Builds Your Page
  • TypeScript Essentials: Types Checked, Then Erased (Interfaces, Unions, Generics)
  • Why React, JSX and Components: The Page as a Function of Data
  • React Props and Composition: Data Down, Calls Up, Children in the Slot
  • Routing With React Router: One Page, Many Addresses
  • React Component Tests With Vitest and Testing Library: Test What the User Sees
  • End-to-End Tests for a React App With Playwright: A Full Dress Rehearsal
  • Why AI-Built Websites All Look the Same, and Four Levels That Fix It
  • Visual Hierarchy, Spacing and the 8-Point Grid: Tell the Eye What to Read First
  • Colour, Contrast and Dark Palettes: 60-30-10, Semantic Tokens and Ratios You Can Compute
  • Typography That Sells: Type Scale, Line Length and Free Font Pairings
  • The UI Element Catalogue: Buttons to Toasts, Their Jobs, States and shadcn/ui Names
  • Design Tokens: Primitive and Semantic Tokens, from Figma to CSS to Tailwind
  • Tailwind CSS 4 in React: Utility Classes, Responsive Prefixes, Hover and Dark Mode
  • shadcn/ui in React: Components You Own, Edit and Commit
  • Design Tokens to a Tailwind Theme: Light and Dark Mode with @theme inline
  • Motion in React: Entrance, Hover, Exit and Layout Animations
  • A React Dashboard: Stat Cards, a Recharts Line Chart and a Sortable Table
  • Accessibility in Practice: Dialogs, Menus and the Keyboard in React
  • Reference-Driven Design: Extract a DESIGN.md From a Site You Admire and Build From It
  • Components, Variants and Variables: One Design System in Figma and in CSS
  • Figma MCP Server: Build a React Component From a Frame, Then Write It Back
  • Claude Design: From a Brief to a Clickable Prototype, Then Hand It Off to Claude Code
  • Critiquing AI-Generated UI: Six Checks for Every Screen
  • The AI Design Landscape: Prompt to UI, Prompt to App, and Design to Code
  • Your Brand Rules Folder: One Folder Every AI-Built Page Follows
  • The Best-Practice UI Prompt: Plain Sentences That Beat the Average AI Page
  • UI Ideas From Figma Make, Google Stitch and ChatGPT: One Prompt, Three Designs
  • Google Stitch From a Sketch or Screenshot: Show the Layout, Say What to Keep
  • Stitch to Figma to Code: Turn a Stitch Screen Into Code That Uses Your Tokens
  • Figma Make: Prompt to Prototype With a Four-Part Prompt
  • Upgrade a Dated UI From One Screenshot (or a Reference Image)
  • States and Feedback: Make Every Click Get an Answer
  • A Design-Loop Skill: Claude Screenshots, Scores and Fixes Its Own UI
  • Copy Without the AI Tells: A Copy Pass on a Landing Page
  • React State, Events, Lists and Conditional Rendering: Follow One Click
  • React useEffect: When It Runs, What Cleanup Is For, and When You Don't Need One
  • Lifting State Up, Refs and React DevTools: Put State Where It Is Needed
  • Forms and Actions in React 19: Controlled Inputs, Form Actions, useActionState and useFormStatus
  • React Context and Custom Hooks: Share One Value, Reuse the Logic
  • Server State With TanStack Query: One Key, One Request, One Cache
  • Mutations and Optimistic Updates in TanStack Query: Change Data, Then Tell the Cache
  • Generate TypeScript Types, Query Hooks and Zod From an OpenAPI Spec With Orval
  • A Mock Backend in the Browser With Mock Service Worker, Generated From the Spec
  • A React Client for a FastAPI API: The CORS Wall, CORSMiddleware and the Vite Proxy
  • Forms With React Hook Form and Zod: The API's Rules in the Browser, the Server's Errors Under the Field
  • JWT Auth in a React Client With a FastAPI Backend: Log In, Carry the Token, Let the Server Decide
  1. Blog
  2. /
  3. React
  4. /
  5. Fundamentals

Critiquing AI-Generated UI: Six Checks for Every Screen

An AI tool can build a tidy-looking dashboard in seconds and still hide six problems. Review it with six questions, measure the contrast with a ten-line script, and fix each issue with a small CSS change, before and after.

Chaand Sheikh

·27 November 2026·Updated 28 November 2026Fundamentals

What you will learn

  • Review an AI-built screen with six questions: hierarchy, states, contrast, consistency, labels and focus
  • Measure text contrast with a small Python script instead of trusting your eyes
  • Fix each problem with a small CSS change: variables, an empty state, a skeleton, clear labels, a focus ring
  • Ask an AI assistant to review and fix a page against the checklist

Before you start

  • Basic HTML and CSS

AI tools can build a page in seconds, so the useful skill now is reviewing what they build. In this lesson we take one AI-generated page, find six problems in it, and fix each one. You'll leave with a checklist you can run on any screen in about two minutes.

The AI draft

We gave an AI tool one prompt: build a dashboard and settings page for a team task app. It came back with three stat cards, two panels and a profile form. It runs, and at first glance it looks tidy.

AI-generated TaskBoard dashboard: a small grey Dashboard title, three stat cards with numbers the same size as their labels and different corner radii, two empty white panels called Recent activity and Reports, and a Profile form with pale grey helper text and buttons labelled Submit, OK and Click here.
The AI draft. It looks tidy, but six problems are hiding in it.

Look closer and the problems show up. Here is the checklist that finds them.

Six questions for every AI screen

#CheckAsk yourselfQuick test
1HierarchyWhat do I see first, second, third?Squint at the page. Does one thing lead?
2StatesWhat if it is empty? Loading? Failed?Remove the data and reload slowly
3ContrastCan I read it?Text needs 4.5 : 1 against its background (large text 3 : 1)
4ConsistencySame radius, same spacing, same sizes?Compare cards, buttons and inputs side by side
5LabelsDoes each button say what it does?Read only the buttons. Do they make sense?
6FocusCan I see where the keyboard is?Press Tab through the page

The AI drafts, and you review.

1. Hierarchy: what comes first?

In the draft, the page title and the numbers on the cards are all about the same size and weight. Nothing leads the eye.

The fix: make the title 28 pixels and bold, make the key numbers 32 pixels, and put small muted labels above them.

h1 { font-size: 28px; font-weight: 800; color: #111827; margin: 0; line-height: 1.2; }
.lbl { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.num { font-size: 32px; font-weight: 800; line-height: 1.15; color: #111827; }

Now your eye knows where to start. The basics of size and weight are covered in Visual Hierarchy, Spacing and the 8-Point Grid.

2. States: empty and loading

The Recent activity and Reports panels are blank. With no data, the user sees an empty white box, and while data is loading there's no sign of it either.

The reviewed page shows an empty state (a short message and a link for the next step) and a skeleton while loading: grey bars with a small pulse.

<div class="panel"><h2>Recent activity</h2><p class="empty">No activity yet. Update a task and it shows up here.<br><a href="#">Create a task</a></p></div>
<div class="panel"><h2>Reports</h2><div class="skeleton w80"></div><div class="skeleton"></div><div class="skeleton w60"></div></div>
.skeleton { height: 10px; border-radius: 6px; background: #e5e7eb; margin: 8px 0; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

Every screen has three extra states to design: empty, loading and error.

3. Contrast: measure it

The grey helper text and the placeholder in the form are hard to read. Don't trust your eyes. Measure it.

The contrast ratio is (lighter + 0.05) / (darker + 0.05), where each colour is first turned into a relative luminance. The project's contrast.py does the sums:

"""WCAG contrast ratio: python contrast.py "#A3A9B3" "#FFFFFF" """
import sys


def lin(c):
    c /= 255
    return c / 12.92 if c <= 0.03928 else ((c + 0.055) / 1.055) ** 2.4


def lum(hex_):
    h = hex_.lstrip('#')
    r, g, b = (int(h[i:i + 2], 16) for i in (0, 2, 4))
    return 0.2126 * lin(r) + 0.7152 * lin(g) + 0.0722 * lin(b)


def ratio(fg, bg):
    a, b = sorted((lum(fg), lum(bg)), reverse=True)
    return (a + 0.05) / (b + 0.05)


if __name__ == '__main__':
    fg, bg = sys.argv[1:3] if len(sys.argv) > 2 else ('#A3A9B3', '#FFFFFF')
    r = ratio(fg, bg)
    print(f'{fg} on {bg} = {r:.1f} : 1  ({"passes" if r >= 4.5 else "fails"} the 4.5 : 1 rule for body text)')

Run it on the draft's grey and on the darker grey from the reviewed page:

python contrast.py "#A3A9B3" "#FFFFFF"
python contrast.py "#5B6472" "#FFFFFF"
#A3A9B3 on #FFFFFF = 2.4 : 1  (fails the 4.5 : 1 rule for body text)
#5B6472 on #FFFFFF = 6.0 : 1  (passes the 4.5 : 1 rule for body text)

Body text needs 4.5 : 1, so the draft's grey fails at 2.4 : 1 and #5B6472 passes at 6.0 : 1. A tiny script, or any free checker, gives you this number in a second. Colour and contrast are explained further in Colour, Contrast and Dark Palettes.

4. Consistency: one radius, one gap

Compare the three cards at the top. The first has a 4 pixel radius, the second 16, and the third none at all. The padding and the gaps keep changing too. AI tools often do this, because each piece is generated on its own.

The fix is two variables, one radius and one spacing step, used by every card:

:root { --radius: 12px; --space: 12px; --muted: #5B6472; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space); margin-bottom: var(--space); }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius); padding: 10px 12px; display: flex; flex-direction: column; }

You don't need to memorise every CSS property. You need to know that variables like these exist, so you can ask the AI for them. That's the idea behind design tokens.

5. Labels: say what it does

The form buttons say Submit, OK and Click here. Read only the buttons and you can't tell what each one does. Which one deletes the account?

The reviewed version says it plainly: Save changes, Discard and Delete account. A good label is a verb and an object.

6. Focus: show the keyboard

Press Tab and the keyboard moves from button to button. In the draft the focus ring was switched off with outline: none, so keyboard users can't see where they are.

The reviewed version brings it back with :focus-visible, which shows a 3 pixel amber outline for keyboard users only. Mouse clicks stay clean.

button:focus-visible { outline: 3px solid #F59E0B; outline-offset: 2px; }

The same page, after the review

Reviewed TaskBoard dashboard: a large bold Dashboard title, three stat cards with uppercase muted labels and large numbers 24, 58 and 3, all with the same radius, a Recent activity panel with an empty-state message and a Create a task link, a Reports panel with grey skeleton bars, and a Profile form with buttons Save changes (with an amber focus ring), Discard and Delete account.
Same content, same prompt, six checks later. The amber ring on Save changes is the keyboard focus.

Nothing was redrawn. The content and the layout are the same; six small fixes made it ready to ship.

Let the AI run the checklist

You can hand the checklist to an AI assistant. Ask it to review first, without changing anything:

Review this page against six checks: hierarchy, empty and loading states, colour contrast (WCAG 4.5 : 1 for body text),
consistency of radius and spacing, button and link labels, and keyboard focus styles. List each problem with the exact CSS line
and the measured contrast ratio where it applies. Do not change anything yet.

Then ask it to fix only what it listed:

Fix only the problems you listed. Use CSS variables for the radius and the spacing, add an empty state and a skeleton loading state,
use specific button labels, and add a visible :focus-visible outline. Show the changed CSS only.

Finish by asking which of the six checks still fail, and check the contrast of every text colour yourself.

Quick recap

CheckProblem in the draftFix
HierarchyTitle and numbers the same size28px bold title, 32px numbers, small muted labels
StatesBlank panelsEmpty message with a next step, skeleton while loading
Contrast#A3A9B3 on white, 2.4 : 1#5B6472, 6.0 : 1
ConsistencyRadius 4, 16 and 0--radius and --space
LabelsSubmit, OK, Click hereSave changes, Discard, Delete account
Focusoutline: none:focus-visible amber outline

Look, measure, fix.

Try it yourself

Ask any AI tool for a small dashboard page, then run the six checks on it before you read its code. Measure every text colour with contrast.py. How many of the six did it get right on the first try?

Tried the exercise? Share your answer or ask a question.

The StudyEasy AI Community is free to join, with the lesson files, notebooks and code.

Join free on Skool

Keep going in React · 36 of 59

Previous
Claude Design: From a Brief to a Clickable Prototype, Then Hand It Off to Claude Code
Next post
The AI Design Landscape: Prompt to UI, Prompt to App, and Design to Code

Related course on Udemy

The Python Architect Masterclass: Full Stack to AI Engineer

Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)

Related posts

One Request, Two Answers: the Same Post as an HTML Page and as JSON

Ask a Django blog for the same post twice: once as a 12,731-byte HTML page built by a template, once as 2,976 bytes of JSON built by a serializer. Compare the headers, see who builds the page, and why the server still owns every write.

A Blog Design from a Prompt: Downloading Figma Make Code and Reading App.tsx and BlogCard.tsx

Make a blog design from a prompt in Figma Make, download src.zip, unzip it with Python's zipfile module, and read the two files that matter: App.tsx with its selectedPost state and BlogCard.tsx with its props.

How a Web Page Works: HTML Tags, Elements and Attributes

A web page is a text file full of labelled pieces. Learn tags, attributes and nesting with three tiny pages, and see what breaks when an attribute or a closing tag is wrong.

Semantic HTML: header, nav, main, aside and footer as Page Landmarks

The same page written as div soup and with semantic tags looks identical, but only one gives screen readers and search engines landmarks and an outline. Plus tables, div, span and the one-main rule.

On this page

  • The AI draft
  • Six questions for every AI screen
  • 1. Hierarchy: what comes first?
  • 2. States: empty and loading
  • 3. Contrast: measure it
  • 4. Consistency: one radius, one gap
  • 5. Labels: say what it does
  • 6. Focus: show the keyboard
  • The same page, after the review
  • Let the AI run the checklist
  • Quick recap
  • Try it yourself
Community · Free to join
Single logo

StudyEasy AI Community

Hosted onSkool

Learn AI engineering, share what you build, and connect with other learners.

  • Free resources: lesson files, notebooks and code

  • Ask questions and join engineering discussions

  • Meet real people learning and building with AI

Join free on Skool

Related course on Udemy

The Python Architect Masterclass: Full Stack to AI Engineer

Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)

Single logo

Empowering Education, One Course at a Time

About
About usContact us
Legal
Terms of UsePrivacy Policy

© 2026 StudyEasy Organization. All rights reserved.