Error Display

A card component for surfacing API errors with optional troubleshooting steps and a support link.

ErrorDisplay renders a styled error card with a warning header, a monospace error message block, an optional children slot for inline troubleshooting content, and a "Contact support" footer link that is always shown.

Loading...

Use ErrorDisplay as the base for any inline error state in the dashboard. For errors with known patterns, wire up ErrorMatcher on top to automatically inject matching troubleshooting steps.

Usage

import { ErrorDisplay } from 'ui-patterns/ErrorDisplay'
<ErrorDisplay
  title="Failed to load tables"
  errorMessage="ERROR: CONNECTION TERMINATED DUE TO CONNECTION TIMEOUT."
  supportFormParams={{ projectRef: 'my-project' }}
/>

Examples

With troubleshooting steps

Pass any content as children — typically a TroubleshootingAccordion — to render inline troubleshooting between the error message and the support footer.

Loading...

Props

PropTypeDefaultDescription
titlestringDisplayed in the card header next to the warning icon.
errorMessagestringRaw error string rendered in a monospace code block.
supportFormParamsSupportFormParams?undefinedTyped params for the support form URL. The component builds the URL.
supportLabelstring?"Contact support"Override the support link label.
childrenReactNodeundefinedSlot for troubleshooting content rendered between message and footer.
iconReactNodeWarning triangleOverride the header icon.
onRender() => void?Fired once on mount — use for telemetry.
onSupportClick() => void?Fired when the support link is clicked — use for telemetry.
classNamestring?Extra classes on the root Card.

SupportFormParams

FieldTypeDescription
projectRefstring?Project reference slug
orgSlugstring?Organisation slug
categorystring?Pre-selected support category
subjectstring?Pre-filled subject line
messagestring?Pre-filled message body
errorstring?Raw error string for context
sidstring?Sentry event ID