--- ## ChatMessage Renders one `ChatMessageData` — its ordered parts (markdown text via StreamingMarkdown, reasoning, tool-call status lines, policy-checked attachment chips) plus a citation footer, streaming placeholder, error/aborted Alert, a hover-revealed copy/regenerate action bar and a timestamp. `layout="bubble"` (default) tints and aligns per role; `layout="plain"` is a document-like full-width Claude-style column. Untrusted URLs never render as inline media — only as `urlPolicy`-checked download links. Compose many of these under ChatMessageList; the consumer owns the `ChatMessageData[]`. **Import:** `import { ChatMessage } from '@urbicon-ui/blocks';` ### Examples ```svelte regenerate(msg.id)} /> ``` ### Variants - density: comfortable, compact (default: comfortable) - layout: bubble, plain (default: bubble) ### Api | Prop | Type | Required | Default | Description | | --- | --- | :---: | --- | --- | | message | `ChatMessageData` | yes | | The message to render. The component never mutates it. | | ...ChatMessageVariants | `VariantProps` | no | | Styling variants from ChatMessageVariants | | ...HTMLAttributes | `HTMLAttributes` | no | | HTML attributes (excluding: 'children' | 'class') | | abortedLabel | `string` | no | 'Generation stopped' | Alert title for `status === 'aborted'`. | | actions | `Snippet<[{ message: ChatMessageData }]>` | no | | Action-bar override. Receives the message; default is copy (+ regenerate when `onRegenerate` is set). | | avatar | `Snippet<[{ role: ChatRole }]>` | no | | Avatar override. Receives the message role; default is the Avatar primitive with a role icon. | | class | `string` | no | | Extra classes merged onto the root element. | | copiedLabel | `string` | no | 'Copied' | Accessible label shown briefly after a successful copy. | | copyLabel | `string` | no | 'Copy message' | Accessible label / tooltip for the copy action. | | errorLabel | `string` | no | 'Something went wrong' | Alert title for `status === 'error'`. | | metadata | `Snippet<[{ message: ChatMessageData }]>` | no | | Metadata override. Receives the message; default is `createdAt` as a `