Patterns / ErrorView

ErrorView

The error view tells a reader that something has failed and what that means for them. It says whether trying again is likely to help and offers the retry where it is, so a failure is something the reader can respond to rather than only observe.

On this page

Like ConfirmationModal, this one the package ships: ErrorView is a module — components arranged in one fixed way and published as a single export, imported exactly the way Button is.

Inside it is an EmptyState fixed to its placeholder type, a glyph carrying the accent, an optional technical line, and a row holding the retry Button plus whatever else you pass. Nothing you could not have assembled — the point is that every failure in every product is now the same one, down to whether a retry is offered at all.

Portfolios · could not load

Error while loading portfolios

Something isn't right. This is usually temporary, and the rest of the page is fine.

request 4f2c91b0 · attempt 1

The retry is real — press it and the detail line counts up, which is the whole of what onRetry does: it draws the button and calls your handler. It does not close anything, clear anything or reload the page, because a failure that has not cleared should stay on screen.

Error while loading news

The section failed. Trying again is worth a shot.

Trend data is too sparse

There is not enough signal here to produce a summary. Try a more general search term.

Both tones, and the difference that matters is on the right: no onRetry, so no button. The data will be exactly as sparse next time, and a retry that cannot succeed teaches people to press it three times and leave. Passing fill={false} is what lets these two sit side by side — on a real surface each would own its region.

When to use

Reach for an error view wherever a request did not come back and a region is left with nothing it can fill itself with — a panel, a table, a whole page. Name the part that failed, say whether the reader should expect it to clear, and offer the retry only where trying again could change the answer. The habit that most often goes wrong is a box that apologises without saying what is missing, which leaves a reader on a page of several sections working out which one to reload.

When not to use

Do not reach for one where nothing failed. An absence that was expected — an empty folder, a finished job, a feature still to come — belongs to EmptyState, and a danger-coloured glyph on it reads as a bug that is not there. An answer still on its way is Skeleton or Spinner rather than a failure declared early. And a single control that will not accept what was typed is not a failed region: that message belongs beside the control, where the reader can act on it without losing what they wrote.

tone

The line between the tones is whether a retry is worth the reader’s time. It is deliberately not a list of HTTP statuses: a 404, a 500 and a dropped connection produce the same screen, because what the reader can do about each is identical. What genuinely differs is whether doing it again would change anything — and that is a question about the failure, not about its code.

toneWhen to use
errorSomething broke, and trying again may well work. --status-danger on the glyph, and the tone to pass when a request failed, a save did not land, or a section came back empty when it should not have.
unavailableThe result cannot be produced right now, and a retry returns the same nothing — the data is too sparse to answer, the upstream service is down, the feature is switched off. --status-warning on the glyph. Usually paired with no onRetry at all, because offering one is a promise the next attempt will break.