A full assistant turn — an identity header (avatar, name, model, status, timestamp), an optional metadata-chip row, a type-specific body, and a Copy / Regenerate / Share / Save / Like / More action bar.
Loading demo: ai-message-real-world
npx sdaia-ui@latest add ai-message
import { AiMessage } from '@/components/ui/AiMessage';1<AiMessage2type="research"3variant="brand"4name="SDAIA Assistant"5model="SDAIA AI · GPT-5.5"6status="source"7timestamp="Just now · 2.4s"8title="What the framework emphasizes"9body="The framework emphasizes transparency, source traceability, and human oversight."10chips={[{ label: "8 sources found" }, { label: "4 files scanned" }]}11citations={[1, 2, 3, 4]}12sources={[{ title: "SDAIA AI Governance Framework.pdf", type: "PDF", meta: "sdaia.gov.sa", verified: true }]}13/>
A plain-text answer — title, body, bullets, an inline link and cited sources.
Loading demo: ai-message-standard
An answer with an auditable reasoning summary (Goal / Evidence / Decision).
Loading demo: ai-message-reasoning
A research answer — metadata chips, cited sources and source cards.
Loading demo: ai-message-research
A code answer — an embedded Artifact Viewer plus apply / run actions and an execution result.
Loading demo: ai-message-code
A generated-image answer — a preview placeholder with caption and meta pills.
Loading demo: ai-message-image-generation
A multi-tool run — a timeline of tool results, the final answer and a document artifact.
Loading demo: ai-message-multi-tool
Brand style — a high-emphasis, brand-coloured message surface.
Loading demo: ai-message-brand
Outline style — a bordered, transparent message surface.
Loading demo: ai-message-outline
Prop | Type | Default | Required |
|---|---|---|---|
type | 'standard' | 'reasoning' | 'research' | 'code' | 'image-generation' | 'multi-tool' | 'standard' | optional |
variant | 'neutral' | 'brand' | 'outline' | 'neutral' | optional |
style | 'neutral' | 'brand' | 'outline' | — | optional |
dir | 'ltr' | 'rtl' | — | optional |
name | ReactNode | — | optional |
model | ReactNode | — | optional |
status | AiStatus | — | optional |
statusLabel | ReactNode | — | optional |
statusAppearance | 'neutral' | 'brand' | 'outline' | 'neutral' | optional |
timestamp | ReactNode | — | optional |
chips | AiMessageChip[] | — | optional |
title | ReactNode | — | optional |
body | ReactNode | — | optional |
bullets | ReactNode[] | — | optional |
link | AiMessageLink | ReactNode | — | optional |
citations | ReactNode[] | — | optional |
sources | AiMessageSource[] | — | optional |
viewAll | AiMessageAction | — | optional |
reasoning | AiMessageReasoning | — | optional |
createdFileChip | AiMessageChip | — | optional |
artifact | Partial<ArtifactViewerProps> | — | optional |
codeActions | AiMessageAction[] | — | optional |
toolResults | AiMessageToolResult[] | — | optional |
image | AiMessageImage | — | optional |
actions | AiMessageAction[] | Copy / Regenerate / Share / Save / Like / More | optional |
labels | Partial<AiMessageLabels> | — | optional |
children | ReactNode | — | optional |
How this component behaves at the three system breakpoints. Spacing and type tokens switch automatically at 768px and 1280px.
| Screen | Behavior |
|---|---|
| Desktop (1280px and up) | Fills its container up to 560px wide. |
| Tablet (768–1279px) | Same layout as desktop, with the tablet token values. |
| Phone (under 768px) | Shrinks to the screen width with the mobile token values. Chip and citation rows wrap to new lines; long titles are truncated. |