# Message

> A chat message with avatar, author, timestamp and actions.

- Category: [App & chat](https://tarve.dev/docs.md#chat)
- Import: `import { Message } from "@tarve/core";`
- Props type: `MessageProps`
- Source: [packages/core/src/chat-controls.ts:108](https://github.com/omarcosr/tarve/blob/main/packages/core/src/chat-controls.ts#L108)

## Usage

```tsx title="Message.tsx"
import { Button, Message, Text } from "@tarve/core";

<Message
  side="incoming"
  author="Assistant"
  avatarFallback="AI"
  timestamp="10:42"
  actions={<Button variant="ghost" size="sm">Copy</Button>}
>
  <Text>Your build finished in 2.4s.</Text>
</Message>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `actions` | `Child` | — |  |
| `author` | `string` | — |  |
| `avatarFallback` | `string` | — |  |
| `avatarSrc` | `string` | — |  |
| `bubbleVariant` | `BubbleVariant` | `"default"` |  |
| `side` | `BubbleSide` | `"incoming"` |  |
| `timestamp` | `string` | — |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `id`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

## Types

```ts title="BubbleSide"
type BubbleSide = "incoming" | "outgoing";
```

```ts title="BubbleVariant"
type BubbleVariant = "default" | "secondary" | "destructive";
```

Previous: [Diff](https://tarve.dev/docs/components/Diff.md) · Next: [Bubble](https://tarve.dev/docs/components/Bubble.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/Message · Index for agents: https://tarve.dev/llms.txt
