Skip to content
Thrum

Result state

The outcome of a whole task or page: a payment went through, an import failed, access is refused, a page does not exist. A large glyph or status code, a title, a sentence, the way out and an optional reference for support. For a list that is simply empty, use the empty state; for a passing note, a toast.

Install

npx shadcn@latest add @thrum-pro/result-state

This is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.

Automatically installs icons circle-alert, circle-check, circle-x and info from the icon set.

Props

PropTypeDefaultDescription
ResultState: status"success" | "error" | "warning" | "info" | "403" | "404" | "500"Default "info"The outcome. The four words draw a 56 pixel glyph in the matching state colour; the three codes print the number, 48 pixels tall.
ResultState: animatedbooleanDefault falseDraw the glyph's strokes in once when it appears: the outline in 200 ms, then the mark. Codes do not draw.
ResultState: headingLevel1 | 2 | 3 | 4 | 5 | 6Default 2The heading level of the title. A result that is the whole page usually takes 1.
ResultState: iconReactNode–Replaces the glyph or the code with your own picture. It is hidden from screen readers.
ResultState: soundbooleanDefault truePlay a sound once when the result appears, if the visitor has sound on: success, warning (also 403 and 404) or error (also 500). Info is silent.
ResultState: ...propsComponentProps<"div">–Every other div attribute is passed through. className is merged last.
ResultStateTitleComponentProps<"h2">–What happened, 20 pixels and semibold, at the level headingLevel sets.
ResultStateDescriptionComponentProps<"p">–What it means and what to do now, at most 448 pixels wide.
ResultStateActionsComponentProps<"div">–The way out, primary action first. The buttons wrap and stay centred.
ResultStateDetailsComponentProps<"div">–A reference for support in a muted monospace box. Long ids break anywhere rather than overflow.

Motion and sound

Motion

  • With animated set, the glyph's outline draws itself in 200 ms and its mark follows 150 ms later. It happens once, when the result appears.
  • Reduced motion: the glyph is complete from the first frame.

Sound

  • When it appears: the success chime for success, the warning tone for warning, 403 and 404, the error tone for error and 500. Info is silent.
  • It plays once, and again only if the status changes.

Sound is off until the visitor turns it on. Pass sound={false} to keep this component silent. How sound works

Accessibility

  • The result has the status role: when it replaces the content of a page, a screen reader reads it without interrupting.
  • The title is a real heading at the level headingLevel sets.
  • The glyph and the code are hidden from screen readers: the title says what happened. Colour is never the only signal; each status has its own glyph or number.
  • Glyphs keep 3 to 1 and text 4.5 to 1 against the page in both themes.
KeysAction
TabMove to the actions, primary first, then to anything inside the details.

Source

SourcePro

The source comes with Pro

TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies

Files and dependencies

Adds
components/ui/result-state.tsx
Packages
None
Brings along
Chart foundationsSound engine
Icons
circle-alertcircle-checkcircle-xinfo

Changelog

  1. 1.0.0 · 2026-12-03First release.

Loading index…

Keyboard shortcuts

/Ctrl KSearch components, docs and actions
?Show this list
AAppearance studio
SSound on or off
MFull or reduced motion
TTheme: auto, light, dark
GSurface: solid or frosted
BBackdrop photograph (under glass)
CCorner radius: square to round
RReplay the demo, on a component page
DDraw new data, on a component page
←→HomeEndMove the cursor in a focused chart
EscClose a dialog, or leave a chart cursor