Skip to content

shadcn.io is not affiliated with official shadcn/ui

Shadcn Message for React

Conversation message row with optional avatar, header, footer, and alignment.

ME
Deploying to prod real quick.
R
It's 4:55 PM. On a Friday.
ME
It's a one-line change.
R
It's always a one-line change 😭.
Alright, let me take a look.
šŸ‘
Oliver is typing...

Installation

bunx --bun shadcn@latest add https://kit.dev/r/message.json

Anatomy

Message
ā”œā”€ā”€ MessageAvatar
└── MessageContent
    ā”œā”€ā”€ MessageHeader
    ā”œā”€ā”€ Bubble
    └── MessageFooter
MessageGroup
ā”œā”€ā”€ Message
└── Message

Usage

import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Bubble, BubbleContent } from "@/components/ui/bubble";
import { Message, MessageAvatar, MessageContent } from "@/components/ui/message";
<Message className="max-w-full min-w-0">
  <MessageAvatar>
    <Avatar>
      <AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
      <AvatarFallback>CN</AvatarFallback>
    </Avatar>
  </MessageAvatar>
  <MessageContent className="min-w-0">
    <Bubble>
      <BubbleContent>How can I help you today?</BubbleContent>
    </Bubble>
  </MessageContent>
</Message>

Demos

Avatar

Group

Actions

Attachment

Markdown

API Reference

Message

div

PropType
AttributeType

MessageGroup

div

PropType
AttributeType

MessageAvatar

div

PropType
AttributeType

MessageContent

div

PropType
AttributeType

MessageHeader

div

PropType
AttributeType

MessageFooter

div

PropType
AttributeType