ErrorState
What a screen shows when something it needed failed, with a way to try again.
Stability: experimental
Props
| Prop | Type | Default | Means |
|---|---|---|---|
title | string | Something went wrong | What went wrong. |
message | string | Details, or what to do. | |
icon | string | alert | The icon in the circle. |
retry | string | Try again | The retry button's label. |
retrying | boolean | false | Shows the retry button loading. |
onRetry | () => void | Shows the retry button, and runs when it is pressed. |
Children
Anything else under the button.
States
| State | Looks like |
|---|---|
default | A danger-tinted circle with the icon, the title and message, and the retry button. |
retrying | The retry button shows a spinner and cannot be pressed. |
Accessibility
| role | alert |
| name | The title. |
| focus | Only the retry button takes focus. |
| notes | Announced when it appears. |
Theme tokens
color.danger color.surface color.ink color.muted space.3 space.6 space.10 radius.full text.heading text.body
Example
<ErrorState message={error.message} retrying={feed.isLoading} onRetry={() => feed.reload()} />