Error primitives for rendering assistant-ui runtime, thread, and message failures inside custom chat interfaces.
For examples and usage patterns, see Error.
Anatomy
import { ErrorPrimitive } from "@assistant-ui/react";
const ErrorDisplay = () => (
<ErrorPrimitive.Root>
<ErrorPrimitive.Message />
</ErrorPrimitive.Root>
);API Reference
Root
The container of a message's error. It carries `data-run-state` (`stale` or `in-progress`) when the error stands for a run another tab or session drove, and announces an in-progress run as a status instead of an alert.This primitive renders a <div> element unless asChild is set.
ErrorPrimitiveRootProps
- asChildboolean | undefined= false
Change the default rendered element for the one passed as a child, merging their props and behavior.
Read the Composition guide for more details.- render?ReactElement | undefined
Message
This primitive renders a <span> element unless asChild is set.
ErrorPrimitiveMessageProps
- asChildboolean | undefined= false
Change the default rendered element for the one passed as a child, merging their props and behavior.
Read the Composition guide for more details.- render?ReactElement | undefined