How to design empty states and error messages that guide users: clear wording, useful next steps, accessible markup and examples to follow.
In this article
A good empty state tells people what the space is for and gives them a clear next step. A good error message says what went wrong, where, and exactly how to fix it, in plain words and without blame. Both are moments when a user is uncertain, so careful wording and a helpful action can turn a dead end into a smooth path forward. This guide shows how to design each, with patterns and examples you can adapt.
Why these screens matter
Teams spend most of their design effort on the ideal screen full of data, yet many people first meet your product when it has no data at all. And at some point everyone hits an error. These are the screens that decide whether a new user keeps going or leaves, and whether an experienced user trusts the product when something breaks.
They are also commonly forgotten during build, because they never appear in the mock-ups. The remedy is to design them on purpose and to list them in your handoff. Our design-to-developer handoff checklist includes empty, error and loading states for exactly this reason.
The kinds of empty state
Not all empty screens are the same, and the right response depends on why the space is empty.
| Type | Example | What to do |
|---|---|---|
| First use | A new account with no projects | Explain the value and offer one clear first action |
| User cleared | An inbox with every message handled | Confirm completion, keep it brief and positive |
| No results | A search or filter that matches nothing | Say so, show what was searched, and suggest changes |
| No permission | A section the person cannot access | Explain why and who can grant access |
| Not loaded | Data failed to arrive | Treat it as an error with a retry, not as emptiness |
The last row matters. Showing "No items" when the real problem is a failed request misleads people into thinking their data has gone. Always distinguish genuinely empty from failed to load.
Designing a helpful empty state
A solid empty state usually has four parts: a short heading, a line of explanation, a primary action, and optionally a supporting visual or secondary link.
- Heading. Name what is missing in plain terms: "No projects yet".
- Explanation. One sentence on what this area is for and why it will be useful: "Projects let you group tasks and share them with your team."
- Primary action. A specific button such as "Create your first project". Avoid vague labels like "Get started" when something more exact is possible.
- Supporting help. A link to a short guide, a sample, or an import option if people often arrive with existing data.
Keep illustrations modest. A friendly image can help, but it should never push the action off a small screen or add heavy page weight. On phones, check that the heading and button remain visible without scrolling; see mobile-first responsive design principles for layout thinking that helps here.
For a no-results state, be even more practical. Echo the search term, suggest removing a filter, check spelling, or offer popular alternatives. Better still, offer a one-click way to clear all filters. Never leave the person staring at an empty table with no explanation.
Anatomy of a good error message
Whether it appears beside a field, in a banner or on a full page, a useful error message answers three questions.
- What happened? State the problem in everyday language.
- Why, if it helps? A short reason can reduce anxiety, such as "Your session expired for security".
- What can I do now? Give a concrete step: retry, edit a field, contact support, or return to a safe place.
Compare these pairs.
- Poor: "Something went wrong." Better: "We could not save your changes because the connection dropped. Your edits are still here. Try saving again."
- Poor: "Invalid password." Better: "That password does not match. Check for typos or reset your password."
- Poor: "Error 404." Better: "We could not find that page. It may have moved. Try the search or return to the home page."
Avoid blame ("You entered an invalid date") in favour of guidance ("Enter the date as DD/MM/YYYY"). Avoid jargon, stack traces and uppercase warnings. And be careful about security: a login error should not reveal whether an email address has an account. Our guide to how to build a secure login system explains why vague, consistent wording is the safer choice there.
Choose the right place and format
Where an error appears should match its scope.
- Inline, beside the field, for validation problems the person can fix right there.
- A summary at the top of a form, linking to each problem field, for submissions with several errors.
- A banner or toast, for system-wide issues or background failures. Do not let important errors disappear on a timer; people may not have time to read them.
- A full-page message, for situations where the person cannot continue, such as a 404, an outage or a permissions block.
Keep the person's work intact wherever possible. If a submission fails, retain what they typed. If a save fails, keep the draft. Offering a safe route out, such as a link to the home page, support or the previous step, prevents dead ends. For forms specifically, see form design best practices.
Make them accessible
An error that only some people can perceive is not much of an error message.
- Do not rely on colour alone. Pair red with an icon and with text.
- Announce changes. Use an appropriate live region, such as role="alert" for urgent messages, so screen readers read them out.
- Link the message to the field with aria-describedby and mark the field with aria-invalid.
- Move focus sensibly. After a failed submit, send focus to the error summary or first invalid field.
- Check contrast. Error text must meet the WCAG 2.2 contrast requirements; confirm current criteria on the W3C site.
- Keep messages visible long enough for people who read slowly or use assistive technology.
The checks are not complicated, but they need doing deliberately. Our article on web accessibility basics for developers goes through them in more detail.
Handle the technical side too
Good messages depend on good behaviour behind the scenes. A few engineering points support the design.
- Use proper status codes. A real 404 page should return a 404 status, not 200, so search engines understand it.
- Map technical failures to human messages. Catch errors at a sensible level and translate them, rather than showing raw API text.
- Log details for your team, not for the user, and provide a reference ID that support can search.
- Offer retry with backoff for temporary failures, and fail gracefully when a feature is unavailable.
- Do not leak sensitive details, such as database errors, file paths or personal data, into messages.
When an API is involved, agree an error format between design and engineering so messages are consistent. Our piece on API integration best practices covers error handling and retries from the technical side.
Common mistakes
- Showing a blank screen when there is no data.
- Calling a failed request "empty".
- Using the same generic message for every error.
- Blaming the user.
- Using humour at the wrong moment.
- Clearing a form after a failed submission.
- Leaving out the next step, so the person is stuck.
- Forgetting to test these states, so they ship broken or unstyled.
What to do next
- List every screen and component that can be empty, and every action that can fail.
- Write a heading, a sentence and an action for each empty state.
- Rewrite your ten most common error messages using the three questions above.
- Add these states to your design files and to your acceptance criteria.
- Test them by deliberately breaking things, using a fresh account and a poor connection.
If you would like help with this, the CloudWiss team in Dublin can talk it through as part of our UI/UX and product design work.
Share this article
General educational information, not legal or professional advice for your specific situation.
