Sub topic 14
Designing empty, loading, error, and success states
This chapter assumes you can sketch a screen with standard components, use realistic content instead of lorem ipsum, and read a basic user flow. Here you will learn to specify the states a screen passes through besides the "happy path" view that most wireframes show.
Why one screen needs several wireframes
A screen that lists orders looks different depending on what the system knows at that moment. A new customer has no orders. A returning customer on a slow connection is waiting for data. A customer whose session expired gets an error. A customer who just cancelled an order sees a confirmation. These are four more layouts, and developers will build all of them. If the wireframes skip them, developers invent them, and the results are often inconsistent.
Treat each screen as a set of states. The happy path with data is only one member of that set.
| State | Question it answers | Typical trigger |
|---|---|---|
| Empty | Why is there nothing here, and what can I do? | First use, no results, cleared content |
| Loading | Is something happening? How long will it take? | Initial fetch, refresh, submit |
| Error | What went wrong, and how do I recover? | Network failure, validation, permission, server fault |
| Success | Did my action work, and what is next? | Completed save, send, purchase |
| Partial or ideal | What does the screen look like with data? | Normal use |
Empty states
There are three common causes of emptiness, and each needs different copy and a different action.
- First use. The user has never created anything. Explain the value and offer the primary action. Example: "No orders yet. When you place an order, you can track it here." with a "Browse products" button.
- No results. A search or filter returned nothing. Show the query, and offer a way out: "No orders match 'blue lamp'. Clear filters or check the spelling."
- Cleared or completed. The user finished everything, such as an empty inbox or task list. A short, positive message is enough, and it often needs no button.
A fourth case is easy to miss: the content is empty because the user lacks permission or the data failed to load. That is an error, not an empty state. Showing "No orders yet" when the request actually failed misleads the user, so keep the two designs distinct.
In a wireframe, draw the empty layout with the real heading, the real message, and the real button. Keep the page chrome (header, navigation, filters) in place so reviewers see how the empty area fits in.
Loading states
Decide which kind of loading each screen needs.
- Skeleton screens draw gray blocks where content will appear. Use them for page or list loads where the layout is predictable.
- Spinners or progress indicators suit short, self-contained waits, such as a button submit. Use a determinate progress bar when you can measure progress, such as a file upload.
- Inline or partial loading updates one region (for example, a filtered list) while the rest stays interactive.
- Optimistic updates show the result immediately and reconcile later. Specify what happens if the server rejects the change.
Annotate three things for each loading state: when it starts, what the user can still do (for example, cancel or navigate away), and what happens if it takes too long. A common rule is to show nothing for very short waits to avoid flicker, show a skeleton after a short delay, and show a message with a retry option after a longer timeout. Write the actual thresholds as proposals, since engineering will confirm what is feasible.
Error states
Errors fall into types that call for different designs.
- Field validation errors appear next to the input, saying what is wrong and how to fix it: "Enter a date after 1 March." Avoid "Invalid input."
- Form-level errors summarize problems at the top when several fields fail, with links to each field.
- Recoverable system errors, such as a lost connection, offer "Try again" and keep the user's entered data.
- Blocking errors, such as a missing page or denied access, explain the situation and offer a next destination.
- Destructive-action errors say clearly whether anything changed. "Your payment was not taken" is more useful than "Something went wrong."
Good error copy names the problem in plain language, says what the user can do, and avoids blame. Wireframe the message text, its position, and its trigger. Do not rely on color alone to signal an error; pair it with an icon and text.
Success states
Success feedback should match the weight of the action.
- Lightweight confirmation, such as a toast or snackbar, suits low-risk actions like "Item saved." It disappears on its own, so never place critical information there.
- Inline confirmation changes the control itself, for example a heart icon filling in.
- Full-screen confirmation suits high-stakes actions like a purchase. Include a summary, a reference number, and the next step.
Specify where the user lands after success, and whether an undo is available. Undo is often better than a confirmation dialog beforehand for reversible actions.
Documenting states efficiently
Drawing every state of every screen is expensive. Prioritize.
- List the screens from your screen inventory.
- For each, ask which states are possible, using the table above as a checklist.
- Draw in full only the states that change layout. Describe the rest in annotations.
- Reuse shared patterns, such as one standard error banner, one skeleton style, and one toast, as components.
A simple state matrix keeps the work visible.
| Screen | Empty | Loading | Error | Success |
|---|---|---|---|---|
| Order history | Drawn | Skeleton | Banner with retry | Not applicable |
| Order detail | Not applicable | Skeleton | Not found page | Cancel toast |
| Cancel order | Not applicable | Button spinner | Inline message | Full confirmation |
Showing states in code
The same discipline appears in front-end code. This example renders one region in four states, using a data-state attribute so a designer or developer can switch between them.
<section id="orders" data-state="empty" aria-live="polite">
<h2>Order history</h2>
<div data-show="loading">
<p>Loading your orders...</p>
</div>
<div data-show="empty">
<p>No orders yet. When you place an order, you can track it here.</p>
<a href="/products">Browse products</a>
</div>
<div data-show="error" role="alert">
<p>We could not load your orders. Your account is unchanged.</p>
<button type="button">Try again</button>
</div>
<ul data-show="ready">
<li>Order #1001 - Shipped</li>
<li>Order #1002 - Delivered</li>
</ul>
</section>
<style>
#orders [data-show] { display: none; }
#orders[data-state="loading"] [data-show="loading"],
#orders[data-state="empty"] [data-show="empty"],
#orders[data-state="error"] [data-show="error"],
#orders[data-state="ready"] [data-show="ready"] { display: block; }
</style>Change data-state to loading, error, or ready to preview each layout. The aria-live region announces changes to screen readers, and role="alert" makes errors announce immediately.
Common mistakes
- Designing only the populated view and leaving the rest to chance.
- Using the same generic message ("Something went wrong") for every error.
- Showing a spinner with no timeout, so the user waits forever.
- Clearing the user's form input when an error occurs.
- Placing essential information in a toast that vanishes.
- Showing an empty state before loading finishes, which causes a visible flash.
Exercise
A search screen returns no results for "blue lamp", and separately the network drops while the user searches. Which two states are these, how should their wireframes differ, and what must each include?
Show answer
The first is an empty state (no results) and the second is an error state. The empty state shows the query, explains that nothing matched, and offers actions such as clearing filters or checking spelling. The error state says the search could not be completed, keeps the user's query, and offers "Try again". They must look and read differently so that a failure is never presented as "no results".
Exercise
Build a state matrix for a "Send message" screen. Name one decision for each of empty, loading, error, and success.
Show answer
Sample answer. Empty: a new conversation shows "No messages yet. Say hello." with the compose box focused. Loading: the send button shows a spinner and is disabled, and the draft stays visible. Error: the message is marked "Not sent" with a "Try again" action, and the text is kept. Success: the message appears in the thread with a "Delivered" label, and no extra confirmation is needed.