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

States and Feedback: Make Every Click Get an Answer

A newsletter form that ignores your clicks, shows a vague Error in the corner and leaves a blank list is not broken in code; it just never answers. Describe the missing moments to the agent and get hover, pressed, sending, success, a field error and a friendly empty list.

Chaand Sheikh

·27 November 2026·Updated 28 November 2026Fundamentals

What you will learn

  • Spot a page that never answers the user: silent clicks, vague errors, blank lists
  • Describe the missing moments to an agent in user words: hover, press, sending, done, field error, empty
  • Click through a page and check each state with five questions

Before you start

  • Using an AI agent in your editor (PyCharm, IntelliJ or VS Code)

A page should answer the user at every moment. You click, it shows it's working, and then it tells you it worked. This lesson takes a small form that never answers and fixes it by describing the missing moments to an agent.

The page that never answers

The page is a newsletter sign-up called "Weekly design notes: one short email every Friday". You type your email and click Subscribe.

  • Nothing changes. So you click again, and again, and wonder whether the click even counted.
  • Then a tiny word appears in the corner: Error. Which error? What should you fix? The page doesn't say.
  • The list below is blank. Is it loading, broken, or simply empty? You can't tell.

Nothing here is broken in the code. The page just never answers you.

Every click gets an answer idle hovera bit darker pressedsinks sendingspinner donegreen + message field error: the field turns red message under it says what to fix bad email empty list says what's next working, done, wrong or empty
Each moment has its own answer. The original page had only "idle" and a vague "Error".

Describe the moments to the agent

Open the form in PyCharm's preview with the AI Chat panel set to the agent. IntelliJ and VS Code work the same way. Then describe what you see as a user, not as a developer:

When I click Subscribe, nothing seems to happen. Make the page answer at every step: the button reacts when I point and press, it shows when it is sending and when it worked, errors say what to fix next to the field, and the list is never just blank.

The agent reads the page and its script, then edits the stylesheet and the script. Its reply: "Every click now gets an answer: sending, done, a clear error by the field, and a friendly empty list." In the preview the button looks like a button, and the empty list says something useful.

You described the moments; the agent built them. There's no CSS in the prompt. You don't need to know which property makes a button sink. You need to know that the moment should exist.

Every click gets an answer

Click through the fixed page and watch each state:

  1. Hover. Point at the button and it gets a little darker. That tells you it's clickable.
  2. Press. It sinks for a moment, then a spinner appears and the label says "Sending…". Your click counted, and you can see it's working.
  3. Done. The button turns green and a short message says you're in and to check your inbox.

Say what happened, and what's next

Now the moments people forget. Type an email with no at sign, emma.clarke.mail.com, and click Subscribe. Instead of a vague word in the corner, the field itself turns red and the message right under it says:

! This email is missing an @. Try name@example.com

It says what's wrong and how to fix it, right where you're looking.

And the list under "Your issues" isn't a blank box any more. It says "Your first one lands here on Friday." Working, done, wrong or empty, the user always knows where they are.

Click through, watch the answer

To check the agent's work, click through the page and ask five questions:

  1. Does the button react when you point at it and press it?
  2. Can you tell it's working?
  3. Do you know it worked?
  4. When something's wrong, does it say what to fix, right by the field?
  5. Is an empty list ever just blank?

If any answer is no, tell the agent what you saw and click through again. Click, watch, tell the agent.

Common mistakes

  • Only designing the happy picture. AI drafts usually show one state. Ask for the rest by name.
  • Errors far from the problem. A message in the corner makes people hunt. Put it under the field.
  • Errors that only say "Error". Say what's wrong and give an example of right.
  • Blank empty states. Say why it's empty and what comes next.
  • Describing CSS instead of moments. "The button reacts when I press" is enough.

Where this fits

States show up in every UI review. They are check two in Critiquing AI-Generated UI, and one line of The Best-Practice UI Prompt: "Show loading, error and empty states."

Try it yourself

Pick any form in your own project. Click it with a bad value, a good value and no data, and write down every moment where the page doesn't answer. Turn that list into one plain request for your agent, then click through again with the five questions.

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 · 45 of 59

Previous
Upgrade a Dated UI From One Screenshot (or a Reference Image)
Next post
A Design-Loop Skill: Claude Screenshots, Scores and Fixes Its Own UI

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 page that never answers
  • Describe the moments to the agent
  • Every click gets an answer
  • Say what happened, and what's next
  • Click through, watch the answer
  • Common mistakes
  • Where this fits
  • 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.