Marigold
v18.0.0-beta.4
Marigold
v18.0.0-beta.4

Application

MarigoldProvider
RouterProvider

Layout

AppShellbeta
Aside
Aspect
Center
Columns
Container
Grid
Inline
Inset
Pagebeta
Panelbeta
Scrollable
Split
Stack
Tiles

Actions

Buttonupdated
ButtonGroupbeta
Link
LinkButton
ToggleButtonbeta

Form

Autocomplete
Calendar
Checkbox
ComboBox
DateField
DatePicker
DateRangePickerbeta
FileField
Form
NumberField
Radio
RangeCalendaralpha
SearchField
SegmentedControlbeta
Select
SelectListupdated
Slider
Switchupdated
TagFieldbeta
TextArea
TextField
TimeField

Collection

Cardupdated
Table
Tag
ActionBaralpha

Navigation

Accordion
Breadcrumbs
Pagination
Sidebarbeta
Tabs
TopNavigationbeta

Overlay

ActionMenualpha
ContextualHelp
Dialog
Drawer
Menuupdated
Toastbeta
Tooltip

Content

Badge
Descriptionalpha
Divider
EmptyStatebeta
ErrorStatebeta
Headline
Keyboardbeta
List
Loader
SectionMessage
SVG
Text
TextValuealpha
Titlealpha

Formatters

DateFormat
NumericFormat

Hooks and Utils

cn
cva
extendTheme
parseFormData
useAsyncListData
useLandmark
useListData
useTheme
VisuallyHidden
Components

ErrorState

Inform users when a page or region failed to load.

The <ErrorState> component communicates that a page or region failed to render or load its data. It is the error sibling of EmptyState: EmptyState says "nothing here, and that is fine", ErrorState says "this broke, and here is what you can do".

It is designed as the fallback UI of an error boundary. The boundary itself stays application-side. See the error boundaries pattern for the full convention covering tiers, focus, and recovery.

Appearance

The appearance of a component can be customized using the variant and size props. These props adjust the visual style and dimensions of the component, available values are based on the active theme.

The selected theme does not has any options for"variant" and "size".

We can't load this data

Something went wrong on our side. Your data is safe.
PropertyTypeDescription
variant-The available variants of this component.
size-The available sizes of this component.

Usage

Use <ErrorState> when content is gone: an error boundary caught a render failure, or a data fetch failed and nothing can be shown in its place. If content is still present and you are annotating it (validation issues, partial failures, warnings), use a SectionMessage instead.

  • Page tier: the route's error boundary renders a complete Page with the route's Title and an <ErrorState headingLevel={2}> below it, and moves focus to the error state.
  • Region tier: a boundary around a Panel's content renders <ErrorState role="alert" headingLevel={3}>, announcing the failure without stealing focus.

Recent invoices

Invoices didn't load

You can retry. The rest of the page is unaffected.
import { Button, ErrorState, Panel, Title } from '@marigold/components';export default () => (  <Panel>    <Panel.Header>      <Title>Recent invoices</Title>    </Panel.Header>    <Panel.Content>      <ErrorState        role="alert"        headingLevel={3}        title="Invoices didn't load"        description="You can retry. The rest of the page is unaffected."        action={          <Button variant="primary" size="small">            Try again          </Button>        }      />    </Panel.Content>  </Panel>);

Content strategy

The title states what failed, the description states what the user can do about it. No apologies, no stack traces, no blame. Offer retry only when retrying can actually succeed. For non-transient failures such as 403 or 404, offer an escape route instead. See the retry microcopy guidance.

Do

  • Name the thing that failed ("Invoices didn't load").
  • Tell users what they can do next (retry, go back).

Don't

  • Avoid technical detail like status codes or stack traces.
  • Avoid offering "Try again" when a retry cannot succeed.

Accessibility

  • The title renders as a real heading (headingLevel, h2 to h6), so the failed region stays part of the document outline.
  • The illustration is decorative and marked with aria-hidden="true".
  • The container passes through role (use role="alert" at region tier), tabIndex, and ref (page-tier fallbacks set tabIndex={-1} and move focus to it on mount).
  • The error is not conveyed by color alone: illustration plus explicit title and description.

Props

ErrorState

Prop

Type

Accessibility props (1)

Prop

Type

Alternative components

  • EmptyState: Use when a request succeeded but returned no data. ErrorState is only for failures.

  • SectionMessage: Use when content is still visible and you are annotating it with a problem or warning, rather than replacing it.

Last update: 4 days ago

EmptyState

Inform users when there is no content to display.

Headline

The title of a content section

On this page

AppearanceUsageContent strategyAccessibilityPropsErrorStateAlternative components