Skip to content
Ballpoint

Message

One message in a conversation: the avatar, the alignment, a header above the bubble and a footer below it.

From shadcn/ui
BP
Ballpoint
How can I help you today?
10:02
ME
Sketch me a margin note.
Delivered

Installation

pnpm dlx shadcn@latest add @ballpoint/message

Usage

tsx
import { Avatar, AvatarFallback } from "@/components/ui/avatar"
import { Bubble, BubbleContent } from "@/components/ui/bubble"
import { Message, MessageAvatar, MessageContent } from "@/components/ui/message"

<Message>
  <MessageAvatar>
    <Avatar><AvatarFallback>BP</AvatarFallback></Avatar>
  </MessageAvatar>
  <MessageContent>
    <Bubble variant="secondary">
      <BubbleContent>How can I help you today?</BubbleContent>
    </Bubble>
  </MessageContent>
</Message>

Examples

Group

Messages in a row from one sender, with only the last showing the avatar.

I had a look at the page.
The hatching reads well.
BP
Only the corner needs another pass.

Header and footer

A sender and a time above; buttons below.

BP
Ballpoint · just now
Blue ink for the keywords, red pen for the names, pencil for the comments.

API reference

Message align
default "start"
"start" | "end"

Which edge of the conversation it sits against; the avatar and footer follow.

MessageGroup
div

Stacks messages from the same sender.

MessageHeader / MessageFooter
div

Above the bubble (a name) and below it (a time, a status, actions). Give icon-only buttons an aria-label.