# ErrorPrimitive URL: /docs/api-reference/primitives/Error Components for displaying error messages in the chat interface. *** title: ErrorPrimitive description: Components for displaying error messages in the chat interface. ---------------------------------------------------------------------------- A component for displaying error messages in the UI. import { ParametersTable } from "@/components/docs/tables/ParametersTable"; ## Anatomy ```tsx import { ErrorPrimitive } from "@assistant-ui/react"; const ErrorDisplay = () => ( ); ``` ## API Reference ### Root Contains all parts of the error display. Renders a `
` element with `role="alert"`. ### Message Displays the error message. By default, it shows the error from the message context if available, or you can provide custom content. ## Usage The ErrorPrimitive is typically used within a MessagePrimitive.Error component to display error states in messages: ```tsx import { MessagePrimitive, ErrorPrimitive } from "@assistant-ui/react"; const MessageWithError = () => ( ); ```