> ## Documentation Index
> Fetch the complete documentation index at: https://anvil.servicetitan.com/llms.txt
> Use this file to discover all available pages before exploring further.

# User Message – Code

> UserMessage displays messages sent by the user with a distinctive bubble style.

> [!WARNING]
>
> Atlas is deprecated. Use [AI Kit](https://anvil.servicetitan.com/docs/building-agentic-experiences) for any new Atlas experiences.

> [tab] Implementation
>
> ext-atlas-user-message-demo
>
> [StackBlitz demo](https://stackblitz.com/github/servicetitan/anvil2-docs-live-code/tree/main/examples/ext-atlas-user-message-demo?file=src/App.tsx)
>
> ```tsx lines expandable theme={null}
> import { UserMessage } from "@servicetitan/anvil2-ext-atlas";
> import { Card } from "@servicetitan/anvil2";
>
> function App() {
>   return (
>     <Card
>       flexDirection="column"
>       gap={4}
>       background="strong"
>       style={{ width: "388px" }}
>     >
>       <UserMessage
>         message="This is a user message"
>         isError={false}
>         onRetry={() => console.log("retry clicked")}
>       />
>     </Card>
>   );
> }
>
> export default App;
> ```
>
> ## Common Examples
>
> ### Basic Usage
>
> Display a message from the user:
>
> ```tsx theme={null}
> import { UserMessage } from "@servicetitan/anvil2-ext-atlas";
>
> function UserMessageExample() {
>   return <UserMessage message="Hello, I need help with scheduling." />;
> }
> ```
>
> ### Error State with Retry
>
> Display a failed message with retry option:
>
> ```tsx theme={null}
> import { UserMessage } from "@servicetitan/anvil2-ext-atlas";
>
> function UserMessageError() {
>   return (
>     <UserMessage
>       message="This message failed to send"
>       isError
>       onRetry={() => resendMessage()}
>     />
>   );
> }
> ```

> [tab] UserMessage API
>
> ```tsx theme={null}
> <UserMessage
>   message="Hello!"
>   isError={false}
>   onRetry={handleRetry}
> />
> ```
>
> ## `UserMessage` Props
>
> **message** `string` *required*
>
> The message content to display.
>
> **className** `string`
>
> Additional CSS class name for custom styling.
>
> **isError** `boolean`
>
> When true, displays the message with error styling.
>
> **onRetry** `() =\> void`
>
> Callback for retry button. Only shown when `isError` is true.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.