# Message

> Message row with avatar, alignment, header, and footer.

Registry name: `message`. HTML docs: https://ui.anuragroy.dev/component/message.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/message.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/message.json`.

Registry JSON: https://ui.anuragroy.dev/r/message.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/message.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

```tsx
import {
  Message,
  MessageAvatar,
  MessageContent,
  MessageFooter,
  MessageHeader
} from "@/components/ui/message"
```

## Usage

```tsx
import { Bubble, BubbleContent } from "@/components/ui/bubble"
import {
  Message,
  MessageContent,
  MessageFooter,
  MessageHeader,
} from "@/components/ui/message"

export function Example() {
  return (
    <Message>
      <MessageContent>
        <MessageHeader>Assistant</MessageHeader>
        <Bubble variant="secondary">
          <BubbleContent>I can group rows and leave room for actions.</BubbleContent>
        </Bubble>
        <MessageFooter>Just now</MessageFooter>
      </MessageContent>
    </Message>
  )
}
```

## API

### Message

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `align` | "start" \| "end" | "start" | Use `end` for user turns. |

## Notes

- `MessageGroup` is also exported for stacked turns.

## See also

- [HTML page](https://ui.anuragroy.dev/component/message): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/message.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
