Separate empty results from failed loads
A visual walkthrough of empty collections, filtered misses and failed requests, with recovery actions that match what the interface actually knows.

A reading list opens with a blank panel and an “Add your first reference” button. That sounds welcoming—until the reader already has a shelf full of saved pages and the request has simply failed. The interface has turned uncertainty into a claim about their data. A more useful design starts by deciding what the application actually knows.
In this walkthrough, the same reading shelf encounters an empty collection, a filter with no matches, and a service failure. Each occupies similar space, but each needs a different next action. The goal is to keep the layout familiar while making its message truthful.
Let the response determine the message
Start with the cause of the empty space. Carbon’s empty-state guidance distinguishes first use, the results of user actions, and situations needing error recovery. That distinction is useful before writing a headline: what happened, what remains available, and which action can change the outcome? Keep the explanation next to the missing content.
Three blank panels, three different jobs
No saved references
A successful, unfiltered response contains no items.
- Explain what belongs here.
- Offer an available way to add the first item.
- Do not imply the user lost existing work.
No filter matches
The loaded collection exists, but the current filter finds none.
- Keep the query visible.
- Explain which scope was searched.
- Offer Clear filter to restore the collection.
Could not load
The request did not provide a usable result.
- Avoid claiming the collection is empty.
- Preserve useful inputs.
- Offer a relevant recovery action.
Our demo loads three sample references, then filters their titles for “animation.” None match. Because this small example has the whole collection locally, it can truthfully say that three references remain. A paginated or server-filtered application may not know that total. Write “No matches for this filter” unless your API supplies the evidence for a stronger statement.
Real demo capture at a 390 px viewport, cropped to the results region. Clear filter restores the three loaded references and returns focus to the search input.Do not convert failures into empty arrays
The technical trap is often a convenient fallback: catch any request problem, return an empty array, and reuse the empty-state component. That removes the distinction the design depends on. MDN’s Fetch guide explains that an HTTP error response does not normally reject the fetch promise. Check the response status, then validate the expected body before treating it as collection data.
async function readShelf(url) {
const response = await fetch(url);
if (!response.ok) throw new Error("Shelf unavailable");
const body = await response.json();
const valid = Array.isArray(body.items) &&
body.items.every(item =>
item && typeof item.title === "string" &&
typeof item.kind === "string");
if (!valid) throw new Error("Unexpected shelf response");
return body.items; // [] is a successful empty result
}
This excerpt is the read boundary, not a complete data layer. Its caller still needs loading, failure and recovery states. The demo prevents overlapping loads while a request is pending. An application that permits concurrent searches also needs to prevent an older response from replacing the current result.
Real demo capture: the local endpoint returned HTTP 503. After restoring that endpoint, Try again loaded the sample list. The failure never became an invitation to create a first item.A retry button is appropriate here because another read can succeed once the temporary failure clears. It is not a universal error action. A permissions response may require requesting access; a signed-out session may need sign-in. Route those cases using the application’s actual response contract, and avoid promising that repeating the same request will fix every problem.
Keep earlier data visibly separate from fresh data
An initial failure gives the reader no verified list. A failed refresh is different: there may already be useful results on screen. For this reading shelf, we retain those references, show when they last loaded, and explain that the refresh failed. This is an editorial design choice for a reading task, not a rule for every kind of data.
Real demo capture after a successful load followed by HTTP 503. All three earlier titles remain. Restoring the endpoint and refreshing removes the notice after a successful response.Retained data needs the same identity as the current view. If the account, workspace or query changes, do not silently relabel old results as the new request’s answer. For decisions that depend on current availability, decide which actions must wait for a fresh response. A timestamp explains age; it does not make an outdated value safe to use.
What the original demo actually verified| Condition | Visible result | Recovery checked |
|---|
| HTTP 200, empty items | First-reference message | Add sample reference creates one local item |
| HTTP 200, no title matches | Query-specific message | Clear filter restores all three references |
| Initial HTTP 503 | Could-not-load message | Try again succeeds after endpoint restoration |
| HTTP 503 after a good load | Earlier list plus refresh notice | Successful refresh clears the notice |
Make recovery understandable without moving the reader
The message should be perceivable when it changes. W3C’s explanation of status messages covers brief updates about results, waiting and errors that do not take focus. The demo keeps a small status element in the page and updates its text, rather than placing the whole list in a live region. Its buttons remain ordinary keyboard-operable controls.
Review focus alongside the copy. Clearing this demo’s filter removes the Clear filter button, so the action returns focus to the search input. During a refresh, the existing toolbar stays in place. Automated checks verified recovery and layout at 960, 390 and 320 px; they checked status semantics, not what a particular screen reader speaks. Include an assistive-technology review in your own acceptance work.
Review the state before approving the screen
Name the evidence
Record whether the request succeeded, what scope it covered and whether earlier data exists.
Choose the recovery
Match the control to the cause: add an item, clear a filter, retry a read or follow an access flow.
Exercise the transition
Use empty, filtered, failed and restored responses. Check that loading finishes and the next action works.
Read it at phone width
Inspect the message, preserved inputs, keyboard focus and announcements alongside the populated state.
A useful empty state makes a small, defensible promise. It tells the reader what is known, what can still be used, and what one action will do next. Start with that evidence, and the illustration, headline and button can all support the same story.
Back to the LOOKFILE blog