MessageList
The MessageList
component renders the list of messages in the Webchat, including:
- System messages
- Bot messages
- User responses
It has custom message renderers for each type of message (e.g. video, image, audio, text and multipart messages).
It displays a typing indicator while waiting for the bot to answer.
Usage
Props
The bot’s avatar image URL, used when rendering bot messages or typing indicators.
The display name of the bot. Also shown in the marquee and typing indicator when no custom sender name is set.
The bot’s short description, used in the marquee area above the message list if enabled.
Whether the bot is currently “typing.” When true
, a typing indicator bubble is displayed at the end of
the message list.
A message shown at the top of the chat window before any user or bot messages. Useful for welcome or onboarding text.
An array of message objects to render in the chat. Can include standard user ('outgoing'
) and bot ('incoming'
) messages, as well as system ('system'
)
messages. You must handle the construction of the RichMessageObject
type.
A mapping of custom message renderers used to override how specific block types are displayed.
A callback function used to send a new message from the message list as a reply.
This is used by input messages (e.g. Button, Dropdown) where the user’s input is sent directly from the message list in a message object.
This means that sendMessage
is required if your want to use the Button
, Dropdown
or any input message types.
Whether to show the bot marquee (bot name, avatar, and description) at the top of the message list. Defaults to
true
.
Standard <ul>
element props. Useful for applying custom class names or event handlers to the outer
container.
Was this page helpful?