Skip to main content
FeedbackLevel 2

Error State

错误状态

WebMobileDesktopDifficulty: Medium

Something actually broke — not "no data", genuinely broken — and the user has to be told what to do about it.

01

Live Demo

Actually clickable
An error state ≠ an empty state. An error has to name the cause and offer a button that actually fixes it.

What you just saw:"Could not load photos. Check your connection and try again" with a "Retry" button, shown in the exact spot where the list content should have been.

02

What it actually is

An error state and an empty state are two different things. An empty state means there was never anything; an error state means there should have been something and the app could not get it. The latter must offer a retry and an explanation, not just a sad face.

error stateerror pagefailure stateerror screenoops screensomething went wrong
03

Anatomy · What it's made of

  1. Icon图标

    A warning or broken-connection symbol, visually toned down

  2. Title标题

    Plain language, no error codes

  3. Reason原因

    Expandable technical detail

  4. Recovery恢复操作

    Such as "Retry" or "Open settings"

04

When to Use

When it fits, and when it doesn't
Error State usage recommendations
SituationUse it?
A data request failedYes
A permission was denied (camera, photos)Yes
The device is in a bad state (offline, out of storage)Yes
The input format is invalidDepends
The content genuinely does not existNo

Do not show users raw technical strings like "Error 500" or "ECONNREFUSED".

A permission error has to offer a "Open settings" shortcut instead of just stating that permission is missing and leaving the user stuck.

05

Similar Patterns

Don't mix these up
06

How to tell AI

Three levels of prompt

Add the component name and specifics

When a list fails to load, show an error state: "Could not load photos", "Check your network connection", and a "Retry" button, with the technical error code tucked inside a collapsible "Details" section.

07

Don't just say this to AI

Bad → Better

Don't say this to AI

Show an error message when loading fails.

Say this instead

Write the error state as plain-language title + cause + recovery action: "Retry" for network errors, "Open settings" (launching settings) for permission errors, "Go back" for 404, put the technical code in a <details> collapsed by default, and show a loading state on the retry button to prevent double submits.

08

Share this card

Social-ready

Turn this pattern into a 3:4 or 1:1 knowledge card and export it as PNG right in the browser. No backend needed.