---
title: "Message | Free React & Tailwind Agents Component | Motion UI"
canonical: "https://blacknest.dev/motion/c/agents/message"
github_source: "https://github.com/Rkj0123/motion-ui-skill/blob/main/components/agents/message.tsx"
install_command: "npx motion-ui-skill add message"
dependencies: ["clsx","lucide-react","motion","react","react-dom","tailwind-merge"]
category: "agents"
subcategory: "agents"
---

# Message

> Composable conversation primitives for message rows, grouped bubbles, avatars, metadata, live markers, and a mount-only trailing-edge pop-up for newly sent rows.

## Install

```bash
npx motion-ui-skill add message
```

## Dependencies

- `clsx`
- `lucide-react`
- `motion`
- `react`
- `react-dom`
- `tailwind-merge`

## Usage

```tsx
"use client";

import { ChatPreview } from "@/components/previews/agents/chat-preview";

export function MessagePreview() {
  return (
    <ChatPreview
      showAvatars
      showMetadata
      assistantVariant="ghost"
      placeholder="Ask a follow-up…"
    />
  );
}
```

## API Reference

### Message

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `from` | `"user" \| "assistant"` | — | Yes | — |
| `animateIn` | `boolean` | `false` | No | Plays a trailing-edge pop-up once when this message row mounts. |
| `className` | `string` | — | No | — |

### MessageGroup

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `spacing` | `"default" \| "compact"` | `compact` | No | — |
| `className` | `string` | — | No | — |

### MessageAvatar

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `placeholder` | `boolean` | `false` | No | Keep an empty avatar slot so grouped messages remain aligned. |
| `className` | `string` | — | No | — |

### MessageContent

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `className` | `string` | — | No | — |

### MessageHeader

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `className` | `string` | — | No | — |

### MessageFooter

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `className` | `string` | — | No | — |

### MessageMarker

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `className` | `string` | — | No | — |

### MessageTyping

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `label` | `string` | `Responding` | No | — |
| `className` | `string` | — | No | — |

### MessageBubble

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `variant` | `"outline" \| "solid" \| "danger" \| "ghost" \| "soft" \| "tint"` | `soft` | No | — |
| `align` | `"end" \| "start"` | — | No | Defaults to the surrounding Message alignment when omitted. |
| `animateIn` | `boolean` | `false` | No | Plays the bubble entrance once when this component mounts. |
| `className` | `string` | — | No | — |

### MessageBubbleCollapsible

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `open` | `boolean` | — | No | — |
| `defaultOpen` | `boolean` | `false` | No | — |
| `onOpenChange` | `((open: boolean) => void)` | — | No | — |
| `collapsedLines` | `2 \| 3 \| 4 \| 5 \| 6` | `4` | No | — |
| `moreLabel` | `ReactNode` | `Show more` | No | — |
| `lessLabel` | `ReactNode` | `Show less` | No | — |
| `contentClassName` | `string` | — | No | — |
| `triggerClassName` | `string` | — | No | — |
| `className` | `string` | — | No | — |

### MessageBubbleContent

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `render` | `ReactElement<unknown, string \| JSXElementConstructor<any>>` | — | No | Replaces the content element while preserving bubble styling. |
| `className` | `string` | — | No | — |

### MessageBubbleGroup

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `spacing` | `"default" \| "compact"` | `compact` | No | — |
| `className` | `string` | — | No | — |

### MessageScroller

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `followOutput` | `boolean` | `true` | No | Keep streamed output pinned while the reader remains near the end. |
| `followThreshold` | `number` | `56` | No | Distance from the end that still counts as following the output. |
| `smooth` | `boolean` | `true` | No | Smoothly follow growing content. |
| `onFollowChange` | `((following: boolean) => void)` | — | No | Reports when the reader leaves or returns to the live edge. |
| `label` | `string` | `Conversation` | No | Accessible label for the scrollable transcript. |
| `busy` | `boolean` | — | No | Marks the transcript as waiting for more streamed content. |
| `navigation` | `"rail"` | — | No | Adds a compact rail for navigating between rendered Message rows. |
| `navigationLabel` | `string` | `Message navigation` | No | Accessible label for the optional message navigation rail. |
| `viewportClassName` | `string` | — | No | — |
| `contentClassName` | `string` | — | No | — |
| `railClassName` | `string` | — | No | — |
| `viewportRef` | `Ref<HTMLElement>` | — | No | — |
| `viewportProps` | `Omit<DetailedHTMLProps<HTMLAttributes<HTMLElement>, HTMLElement>, "ref" \| "className" \| "children">` | — | No | — |
| `contentProps` | `Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref" \| "className" \| "children">` | — | No | — |
| `className` | `string` | — | No | — |

## Source Files

- [components/agents/message.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/agents/message.tsx)
- [components/agents/agent-disclosure.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/agents/agent-disclosure.tsx)
- [components/agents/citations.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/agents/citations.tsx)
- [components/agents/message-bubble.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/agents/message-bubble.tsx)
- [components/agents/message-context.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/agents/message-context.tsx)
- [components/agents/message-scroller.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/agents/message-scroller.tsx)
- [components/agents/prompt-input.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/agents/prompt-input.tsx)
- [components/agents/streaming-response.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/agents/streaming-response.tsx)
- [components/motion/button/base.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/motion/button/base.tsx)
- [components/motion/button/index.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/motion/button/index.tsx)
- [components/motion/button/magnetic.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/motion/button/magnetic.tsx)
- [components/motion/button/metallic.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/motion/button/metallic.tsx)
- [components/motion/button/stateful.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/motion/button/stateful.tsx)
- [components/motion/magnetic.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/motion/magnetic.tsx)
- [components/motion/popover-morph.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/motion/popover-morph.tsx)
- [components/motion/popover-position.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/motion/popover-position.ts)
- [components/motion/preview-rail.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/motion/preview-rail.tsx)
- [components/motion/select.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/motion/select.tsx)
- [components/previews/agents/chat-preview.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/components/previews/agents/chat-preview.tsx)
- [lib/ease.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/ease.ts)
- [lib/favicon.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/favicon.ts)
- [lib/hooks/use-dismiss.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/hooks/use-dismiss.ts)
- [lib/hooks/use-favicon.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/hooks/use-favicon.ts)
- [lib/hooks/use-hover-capable.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/hooks/use-hover-capable.ts)
- [lib/hooks/use-hover-gesture.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/hooks/use-hover-gesture.ts)
- [lib/hooks/use-tap-gesture.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/hooks/use-tap-gesture.ts)
- [lib/portal.tsx](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/portal.tsx)
- [lib/touch.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/touch.ts)
- [lib/utils.ts](https://github.com/Rkj0123/motion-ui-skill/blob/main/lib/utils.ts)
