Chatbot container

Container

The PatternFly chatbot is a separate window that overlays or is embedded within other UI content. This container can be shown and hidden via the chatbot toggle.

The <Chatbot> component is the container that encompasses the chatbot experience. It adapts to various display modes (overlay/default, docked, fullscreen, and embedded) and supports both light and dark themes.

The "embedded" display mode is meant to be used within a PatternFly page or other container within your product.

Container screenshot

Content and message box

The <ChatbotContent> component is the container that is placed within the <Chatbot>, between the <ChatbotHeader> and <ChatbotFooter>.

<ChatbotContent> usually contains a <ChatbotMessageBox> for displaying messages.

Your code structure should look like this:

<Chatbot>
  <ChatbotHeader ... />
  <ChatbotContent>
    <ChatbotMessageBox>
    ...
    <ChatbotMessageBox>
  </ChatbotContent>
  <ChatbotFooter ... />
</Chatbot>

Note: When messages update, it is important to announce new messages to users of assistive technology. To do this, make sure to set the announcement prop on <MessageBox> whenever you display a new message in <MessageBox>. You can view this in action in our basic chatbot and embedded chatbot demos.

Welcome prompt

To introduce users to the chatbot experience, a welcome prompt can fill the message box before they input their first message. This brief message should follow our conversation design guidelines to welcome users to the chatbot experience and encourage them to interact.

To provide users with a more specific direction, you can also include optional welcome prompts.

Hello, Chatbot User
How may I help you today?

Topic 1
Helpful prompt for Topic 1
Topic 2
Helpful prompt for Topic 2

Props

Chatbot

*required
NameTypeDefaultDescription
childrenrequiredReact.ReactNodeContent to be displayed in the chatbot
classNamestringCustom classname for the Chatbot component
displayModeChatbotDisplayModeChatbotDisplayMode.defaultDisplay Mode for the Chatbot
isVisiblebooleantrueVisibility flag for the chatbot

ChatbotContent

*required
NameTypeDefaultDescription
childrenrequiredReact.ReactNodeContent to be displayed in the chatbot
classNamestringCustom classname for the ChatbotContent component

MessageBox

*required
NameTypeDefaultDescription
childrenrequiredReact.ReactNodeContent to be displayed in the message box
announcementstringContent that can be announced, such as a new message, for screen readers
ariaLabelstring'Scrollable message log'Custom aria-label for scrollable portion of message box
classNamestringCustom classname for the MessageBox component

ChatbotWelcomePrompt

*required
NameTypeDefaultDescription
descriptionrequiredstringWelcome message
titlerequiredstringTitle for the welcome message
classNamestringCustom classname for the WelcomePrompt component
promptsWelcomePrompt[]Custom basic prompts to help users coming for the first time to chatbot

WelcomePrompt

*required
NameTypeDefaultDescription
messagerequiredstringMessage for the welcome prompt
onClick() => voidCallback handler for the onClick event for welcome prompt
titlestringTitle for the welcome prompt