# ErrorPrimitive URL: /docs/api-reference/primitives/error Components for displaying error messages in the chat interface. A component for displaying error messages in the UI. Anatomy \[#anatomy] ```tsx import { ErrorPrimitive } from "@assistant-ui/react"; const ErrorDisplay = () => ( ); ``` API Reference \[#api-reference] Root \[#root] Contains all parts of the error display. Renders a `
` element with `role="alert"`. Message \[#message] Displays the error message. By default, it shows the error from the message context if available, or you can provide custom content. Usage \[#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 = () => ( ); ```