Skip to content
Browse docs and components

Message

message

Chat messages assembled from parts: avatar, header, bubble, footer, groups, markers, a typing indicator and a measured Show more. The side is set once and every part follows it, with no provider.

Responsive

Install

$npxshadcnadd@forme/message

Adds the component, its registry dependencies, and the token stylesheet you import once.

API reference

Read from the source, so it is the API of the file you install. A prop marked * is required.

Message

One turn of a conversation, assembled from parts:

PropTypeDefaultDescription
from*'user' | 'assistant'—
animateboolean—Rises into place when it mounts. Set it on messages that arrive, not on loaded history.

Also takes every prop of <article> attributes.

MessageAvatar

An image, initials or an icon.

PropTypeDefaultDescription
placeholderboolean—Keeps the avatar's space but draws nothing, so a group's bubbles stay aligned.

Also takes every prop of <div> attributes.

MessageBubble

The words. Bubbles take a tail corner on the speaker's side, so a run of them reads as one voice.

PropTypeDefaultDescription
variant'danger' | 'auto' | 'soft' | 'outline' | 'plain'"auto"

Also takes every prop of <div> attributes.

MessageTyping

The assistant is composing. Put it inside a bubble so it takes that bubble's shape.

PropTypeDefaultDescription
labelstring"Responding"What a screen reader hears.
classNamestring—

The other parts

  • MessageGroupTakes <div> attributes
  • MessageContentTakes <div> attributes
  • MessageHeaderTakes <div> attributes
  • MessageFooterTakes <div> attributes
  • MessageMarkerTakes <div> attributes