Duolith docs

ErrorState

What a screen shows when something it needed failed, with a way to try again.

Stability: experimental

Props

PropTypeDefaultMeans
titlestringSomething went wrongWhat went wrong.
messagestringDetails, or what to do.
iconstringalertThe icon in the circle.
retrystringTry againThe retry button's label.
retryingbooleanfalseShows the retry button loading.
onRetry() => voidShows the retry button, and runs when it is pressed.

Children

Anything else under the button.

States

StateLooks like
defaultA danger-tinted circle with the icon, the title and message, and the retry button.
retryingThe retry button shows a spinner and cannot be pressed.

Accessibility

rolealert
nameThe title.
focusOnly the retry button takes focus.
notesAnnounced 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()} />