Components / AI chat
Chat message
A user or assistant turn with copy, edit, retry and timestamp actions.
@fabrials/ai-ui
Installation
Import the control from
@fabrials/ai-ui, after setting the app up.TypeScript import { ChatMessage, MessageActions, MessageAction, CopyMessageAction, MessageTimestamp } from "@fabrials/ai-ui";import "@fabrials/ai-ui/styles.css";
API reference
| Prop / export | Type | Description |
|---|---|---|
from | ChatRole | user, assistant or system. User turns sit in a bubble. |
actions | ReactNode | MessageActions for this turn. |
pinActions | boolean | Keeps actions visible instead of revealing them on hover and focus. |
text | string | CopyMessageAction writes it to the clipboard. A function works too. |
dateTime | string | MessageTimestamp shows label with detail in a tooltip. |
Behavior
Presentational. The host supplies the rendered content, including its markdown renderer, and decides what edit and retry do.
Accessibility
Keyboard and contrast
Keep visible labels, keyboard focus and status announcements when customizing. These components inherit your theme; maintain sufficient contrast in both color modes. The preview is keyboard operable.