Error state

The error state component repurposes the EmptyState component to display an error to users. To further customize this component, you can also utilize all properties of the empty state component, with the exception of children.

Examples

Basic error state

To provide users with error details, a basic error state should contain an appropriate and informative titleText and bodyText. Error state provides a default action to navigate back to the previous page, or the home page in the empty state's footer.

Sample error title

Sample error description

To override the default action button, specify your own using customFooter.

Customizations using EmptyState props

All properties of the empty state component are spread to the error state component group. Passing status='none' to the error state will cause the icon color to be grey.

Sample error title

Sample error description

Props

ErrorState

extends EmptyStateProps
*required
NameTypeDefaultDescription
bodyTextReact.ReactNodeA description of the error, if no body text is provided then it will be set to the defaultBodyText.
customFooterReact.ReactNodeCustom footer content
defaultBodyTextReact.ReactNodeA default description of the error used if no errorDescription is provided.
headingLevelNo type info"h4"
ouiaIdstring | number"ErrorState"ErrorState OUIA ID
status'danger' | 'warning' | 'success' | 'info' | 'custom' | 'none'EmptyStateStatus.dangerStatus of the error message.
titleTextstring'Something went wrong'Title of the error.
variantNo type infoEmptyStateVariant.lg