Skip to main content

Settings

This page documents all available sections and properties that may be passed into the settings prop of the ChatBot. For an example on how to structure your settings, please refer to the default settings in the dropdown below.

Click to view default settings
const DefaultSettings: Settings = {
general: {
primaryColor: "#42b0c5",
secondaryColor: "#491d8d",
fontFamily: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', " +
"'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', " +
"sans-serif",
showHeader: true,
showFooter: true,
showInputRow: true,
actionDisabledIcon: actionDisabledIcon,
embedded: false,
flowStartTrigger: "ON_LOAD",
},
tooltip: {
mode: "CLOSE",
text: "Talk to me! 😊",
},
chatButton: {
icon: ChatIcon,
},
header: {
title: (
<div style={{cursor: "pointer", margin: 0, fontSize: 20, fontWeight: "bold"}} onClick={
() => window.open("https://github.com/tjtanjin/")
}>
Tan Jin
</div>
),
showAvatar: true,
avatar: botAvatar,
buttons: [Button.NOTIFICATION_BUTTON, Button.AUDIO_BUTTON, Button.CLOSE_CHAT_BUTTON],
closeChatIcon: CloseChatIcon,
},
notification: {
disabled: false,
defaultToggledOn: true,
volume: 0.2,
icon: NotificationIcon,
iconDisabled: NotificationIconDisabled,
sound: notificationSound,
showCount: true,
},
audio: {
disabled: true,
defaultToggledOn: false,
language: "en-US",
voiceNames: ["Microsoft David - English (United States)", "Alex (English - United States)"],
rate: 1,
volume: 1,
icon: AudioIcon,
iconDisabled: AudioIconDisabled,
},
chatHistory: {
disabled: false,
maxEntries: 30,
storageKey: "rcb-history",
storageType: "LOCAL_STORAGE",
viewChatHistoryButtonText: "Load Chat History ⟳",
chatHistoryLineBreakText: "----- Previous Chat History -----",
autoLoad: false,
},
chatInput: {
disabled: false,
allowNewline: false,
enabledPlaceholderText: "Type your message...",
disabledPlaceholderText: "",
showCharacterCount: false,
characterLimit: -1,
botDelay: 1000,
sendButtonIcon: SendButtonIcon,
blockSpam: true,
sendOptionOutput: true,
sendCheckboxOutput: true,
buttons: [Button.VOICE_MESSAGE_BUTTON, Button.SEND_MESSAGE_BUTTON]
},
chatWindow: {
showScrollbar: false,
autoJumpToBottom: false,
showMessagePrompt: true,
messagePromptText: "New Messages ↓",
messagePromptOffset: 30,
defaultOpen: false,
},
sensitiveInput: {
maskInTextArea: true,
maskInUserBubble: true,
asterisksCount: 10,
hideInUserBubble: false,
},
userBubble: {
animate: true,
showAvatar: false,
avatar: userAvatar,
simStream: false,
streamSpeed: 30,
dangerouslySetInnerHtml: false,
},
botBubble: {
animate: true,
showAvatar: false,
avatar: botAvatar,
simStream: false,
streamSpeed: 30,
dangerouslySetInnerHtml: false,
},
voice: {
disabled: true,
defaultToggledOn: false,
language: "en-US",
timeoutPeriod: 10000,
autoSendDisabled: false,
autoSendPeriod: 1000,
sendAsAudio: false,
icon: VoiceIcon,
iconDisabled: VoiceIconDisabled,
},
footer: {
text: (
<div style={{cursor: "pointer", display: "flex", flexDirection: "row", alignItems: "center", columnGap: 3}}
onClick={() => window.open("https://react-chatbotify.com")}
>
<span key={0}>Powered By </span>
<div
key={1}
style={{
borderRadius: "50%",
width: 14,
height: 14,
display: "flex",
justifyContent: "center",
alignItems: "center",
background: "linear-gradient(to right, #42b0c5, #491d8d)",
}}
>
<ChatIcon style={{ width: "80%", height: "80%", fill: "#fff" }} />
</div>
<span key={2} style={{fontWeight: "bold"}}> React ChatBotify</span>
</div>
),
buttons: [Button.FILE_ATTACHMENT_BUTTON, Button.EMOJI_PICKER_BUTTON]
},
fileAttachment: {
disabled: false,
multiple: true,
accept: ".png",
icon: FileAttachmentIcon,
iconDisabled: FileAttachmentIcon,
sendFileName: true,
showMediaDisplay: false,
},
emoji: {
disabled: false,
icon: EmojiIcon,
iconDisabled: EmojiIcon,
list: ["😀", "😃", "😄", "😅", "😊", "😌", "😇", "🙃", "🤣", "😍", "🥰", "🥳", "🎉", "🎈", "🚀", "⭐️"]
},
toast: {
maxCount: 3,
forbidOnMax: false,
dismissOnClick: true,
},
event: {
rcbPreInjectMessage: false,
rcbPostInjectMessage: false,
rcbStartStreamMessage: false,
rcbChunkStreamMessage: false,
rcbStopStreamMessage: false,
rcbRemoveMessage: false,
rcbLoadChatHistory: false,
rcbToggleChatWindow: false,
rcbToggleAudio: false,
rcbToggleNotifications: false,
rcbToggleVoice: false,
rcbChangePath: false,
rcbShowToast: false,
rcbDismissToast: false,
rcbUserSubmitText: false,
rcbUserUploadFile: false,
rcbTextAreaChangeValue: false,
rcbPreLoadChatBot: false,
rcbPostLoadChatBot: false,
},
ariaLabel: {
chatButton: "open chat",
audioButton: "toggle audio",
closeChatButton: "close chat",
emojiButton: "emoji picker",
fileAttachmentButton: "upload file",
notificationButton: "toggle notifications",
sendButton: "send message",
voiceButton: "toggle voice",
inputTextArea: "input text area",
},
device: {
desktopEnabled: true,
mobileEnabled: true,
applyMobileOptimizations: true,
}
}
Info

Default values for icons, avatars and JSX Elements may not be reflected in the tables below due to space constraints. If you would like information on those, you may refer to the source code containing the default settings here.

Sections

Below is a list of available sections along with a brief description for each of them:

NameTypeDescription
ariaLabelobjectConfiguration for chatbot accessibility.
audioobjectConfiguration for chatbot audio.
botBubbleobjectConfiguration for bot chat bubbles.
chatButtonobjectConfiguration for the chatbot button.
chatWindowobjectConfiguration for the chatbot window.
chatHistoryobjectConfiguration for chatbot chat history.
chatInputobjectConfiguration for chatbot input.
deviceobjectConfiguration for chatbot behavior on different devices.
emojiobjectConfiguration for chatbot emojis.
eventobjectConfiguration for chatbot events.
fileAttachmentobjectConfiguration for chatbot file attachments.
footerobjectConfiguration for the chatbot footer.
generalobjectConfiguration for the general aspects of the chatbot.
headerobjectConfiguration for the chatbot header.
notificationobjectConfiguration for chatbot notifications.
sensitiveInputobjectConfiguration for chatbot sensitive input.
toastobjectConfiguration for the chatbot toast.
tooltipobjectConfiguration for the chatbot tooltip.
userBubbleobjectConfiguration for user chat bubbles.
voiceobjectConfiguration for chatbot voice.

Section Details

Below is a detailed description of each section and the properties they contain.


ariaLabel

Properties here provide accessible labels for various chatbot interface elements. These labels are used by screen readers to enhance accessibility for users.

NameTypeDefaultDescription
chatButtonstring"open chat"Accessible label for the button that opens the chat window.
audioButtonstring"toggle audio"Accessible label for the button that toggles audio.
closeChatButtonstring"close chat"Accessible label for the button that closes the chat window.
emojiButtonstring"emoji picker"Accessible label for the button that opens the emoji picker.
fileAttachmentButtonstring"upload file"Accessible label for the button that allows users to upload files.
notificationButtonstring"toggle notifications"Accessible label for the button that toggles notifications on or off.
sendButtonstring"send message"Accessible label for the button that sends input message.
voiceButtonstring"toggle voice"Accessible label for the button that toggles voice.
inputTextAreastring"input text area"Accessible label for the text area where users input their messages.

audio

Properties here handle the playing of audio for messages sent by the bot. When toggled on, messages sent by the bot will be read out. Note that audio is not supported for messages sent in real-time stream.

NameTypeDefaultDescription
disabledbooleantrueSpecifies whether chatbot audio is disabled.
defaultToggledOnbooleanfalseSpecifies whether chatbot audio is toggled on by default.
languagestring"en-US"The language for chatbot audio, set by a string representing a BCP 47 language tag.
voiceNamesArray<string>"Google US English Male"An array of voice names for the chatbot audio. Voices are based off what is provided in SpeechSynthesis - you can provide as many voices as you wish (the first voice matched will be used).
ratenumber1The rate (between 0.1 to 10) at which chatbot audio is played.
volumenumber1The volume (between 0 to 1) at which chatbot audio is played.
iconSVGElement | string-SVG element import or image URL for the audio icon to be displayed in the chatbot interface.
iconDisabledSVGElement | string-SVG element import or image URL for the audio icon to be displayed in the chatbot interface when it is disabled.

botBubble

Properties here handle the chat bubble for messages sent by the bot.

NameTypeDefaultDescription
animatebooleantrueSpecifies whether the bot chat bubbles should be animated.
showAvatarbooleanfalseSpecifies whether the avatar should be displayed for bot chat bubbles.
avatarstring-Image import or URL for the avatar to be displayed for bot chat bubbles.
simStreambooleanfalseSpecifies whether to simulate text messages from the bot as a stream.
streamSpeednumber30Specifies the interval in milliseconds between streaming each character (ignored if simStream is false).
dangerouslySetInnerHtmlbooleanfalseSpecifies whether to allow setting of raw HTML content within a bot message bubble (if true, do sanitize input strings and use with caution).

chatButton

Properties here handle the chat button that is used to toggle chat window. Note that the chat button does not show if chat window is embedded.

NameTypeDefaultDescription
iconSVGElement | string-SVG element import or image URL for the chatbot button.

chatWindow

Properties here handle the UI/UX in the chat window. Note that it is recommended to stick to default values for this section as they have been optimized for the ideal experience.

NameTypeDefaultDescription
showScrollbarbooleanfalseSpecifies whether scrollbar will be shown when chat messages overflow the window.
autoJumpToBottombooleanfalseSpecifies whether new messages will always send the user to the bottom of the chat window (recommended to keep false as this can be disruptive).
showMessagePromptbooleantrueSpecifies whether to show a message prompt when new messages are received while a user is scrolling the window.
messagePromptTextstring"New Messages ↓"The text to be displayed on the message prompt shown.
messagePromptOffsetnumber30The offset (in pixels) that the user must be from the bottom of the chat window to be considered scrolling and thus see the message prompt (recommended to keep at 30 or higher).
defaultOpenbooleanfalseSpecifies whether the chat window should be open by default (ignored if chatbot is embedded).

chatHistory

Properties here handle the viewing of chat history.

NameTypeDefaultDescription
disabledbooleanfalseSpecifies whether chatbot chat history is disabled.
maxEntriesnumber30The maximum number of chat history entries to display.
storageKeystring"rcb-history"The key to use for storing chat history. Can be ignored if you only have a single instance of the chatbot on your website. Otherwise, if multiple chatbots share the same storage key, their chat history will overlap.
storageTypestring"LOCAL_STORAGE"The type of storage to use for chat history which can either be LOCAL_STORAGE or SESSION_STORAGE.
viewChatHistoryButtonTextstring"Load Chat History"The text to be displayed on the view chat history button.
chatHistoryLineBreakTextstring"----- Previous Chat History -----"The text to be displayed as a line break in the chat history.
autoLoadbooleanfalseSpecifies whether to automatically load chat history on start (requires disabled to be set to false as well)

chatInput

Properties here handle the chat input sent by the user. Note that when chatbot input is disabled, emoji picker and voice will also be disabled.

NameTypeDefaultDescription
disabledbooleanfalseSpecifies whether chatbot input is disabled (can be overriden by the chatDisabled attribute within a Block).
allowNewlinebooleanfalseSpecifies whether newline is allowed in chatbot input.
enabledPlaceholderTextstring"Type your message..."The placeholder text to display in the chat input when it is enabled.
disabledPlaceholderTextstring""The placeholder text to display in the chat input when it is disabled.
showCharacterCountbooleanfalseSpecifies whether to show the character count and limit (note that this value is ignored if characterLimit is not set to 0 or more).
characterLimitnumber-1The maximum number of characters allowed in the chat input, defaults to -1 (no limit).
botDelaynumber1000The delay in milliseconds before chatbot responses are displayed (minimum value of 500).
sendButtonIconSVGElement | string-SVG element import or image URL for the send button to be displayed in the chat input.
blockSpambooleantrueSpecifies whether user input should be blocked while the bot is processing its next action (highly recommended to keep this true as spamming messages can result in unexpected behaviors).
sendOptionOutputbooleantrueSpecifies whether to send user option as a message to the bot.
sendCheckboxOutputbooleantrueSpecifies whether to send user selection(s) as a message to the bot.
buttonsArray<string | JSX.Element>[Button.VOICE_MESSAGE_BUTTON, Button.SEND_MESSAGE_BUTTON]An ordered list of buttons to show in the chat input (supports both default buttons and custom components) - for the list of default buttons, import the Button constant from the library.

device

Properties here handle the chatbot behavior on different devices (e.g. desktop/mobile).

NameTypeDefaultDescription
desktopEnabledbooleantrueSpecifies whether the chatbot is enabled for users on desktop.
mobileEnabledbooleantrueSpecifies whether the chatbot is enabled for users on mobile.
applyMobileOptimizationsbooleantrueSpecifies if optimizations should be applied on mobile (e.g. auto fullscreen for better viewing). This option is irrelevant if mobileEnabled is false.

emoji

Properties here handle the emoji picker. Note that this feature will be disabled if chat input is disabled.

NameTypeDefaultDescription
disabledbooleanfalseSpecifies whether emoji picker is disabled.
iconSVGElement | string-SVG element import or image URL for the emoji icon to be displayed in the chatbot footer.
iconDisabledSVGElement | string-SVG element import or image URL for the emoji icon to be displayed in the chatbot footer when it is disabled.
listArray<string>["😀", "😃", "😄", "😅", "😊", "😌", "😇", "🙃", "🤣", "😍", "🥰", "🥳", "🎉", "🎈", "🚀", "⭐️"]An array of emojis available for selection in the emoji picker.

event

Properties here handle the events emitted by the chatbot. All events have a default value of false. By enabling these events, the chatbot will emit the respective events when specific actions are triggered within the bot's lifecycle.

NameTypeDefaultDescription
RcbChangePathbooleanfalseSpecifies whether the RcbChangePathEvent will be emitted.
RcbChunkStreamMessagebooleanfalseSpecifies whether the RcbChunkStreamMessageEvent will be emitted.
RcbDismissToastbooleanfalseSpecifies whether the RcbDismissToastEvent will be emitted.
RcbLoadChatHistorybooleanfalseSpecifies whether the RcbLoadChatHistoryEvent will be emitted.
RcbPostInjectMessagebooleanfalseSpecifies whether the RcbPostInjectMessageEvent will be emitted.
RcbPreInjectMessagebooleanfalseSpecifies whether the RcbPreInjectMessageEvent will be emitted.
RcbRemoveMessagebooleanfalseSpecifies whether the RcbRemoveMessageEvent will be emitted.
RcbShowToastbooleanfalseSpecifies whether the RcbShowToastEvent will be emitted.
RcbStartStreamMessagebooleanfalseSpecifies whether the RcbStartStreamMessageEvent will be emitted.
RcbStopStreamMessagebooleanfalseSpecifies whether the RcbStopStreamMessageEvent will be emitted.
RcbToggleAudiobooleanfalseSpecifies whether the RcbToggleAudioEvent will be emitted.
RcbToggleChatWindowbooleanfalseSpecifies whether the RcbToggleChatWindowEvent will be emitted.
RcbToggleNotificationsbooleanfalseSpecifies whether the RcbToggleNotificationsEvent will be emitted.
RcbToggleVoicebooleanfalseSpecifies whether the RcbToggleVoiceEvent will be emitted.
RcbUserSubmitTextbooleanfalseSpecifies whether the RcbUserSubmitTextEvent will be emitted.
RcbUserUploadFilebooleanfalseSpecifies whether the RcbUserUploadFileEvent will be emitted.
RcbTextAreaChangeValuebooleanfalseSpecifies whether the RcbTextAreaChangeValueEvent will be emitted.

fileAttachment

Properties here handle the file attachment button.

NameTypeDefaultDescription
disabledbooleanfalseSpecifies whether chatbot file attachments are disabled.
multiplebooleantrueSpecifies whether multiple file attachments are allowed.
acceptstring*The accepted file types for file attachments (e.g. ".png, .jpg" to restrict file types or * to accept all file types).
sendFileNamebooleantrueSpecifies whether to send a message with name(s) of file attachments as a message to the bot.
showMediaDisplaybooleantrueSpecifies whether file attachments that are either image, video or audio will be displayed (previewed).
iconSVGElement | string-SVG element import or image URL for the file attachment icon to be displayed in the chatbot footer.
iconDisabledSVGElement | string-SVG element import or image URL for the file attachment icon to be displayed in the chatbot footer when it is disabled.

Properties here handle the chat footer.

NameTypeDefaultDescription
textstring | JSX.Element-The text or JSX element to be displayed in the chatbot footer.
buttonsArray<string | JSX.Element>[Button.FILE_ATTACHMENT_BUTTON, Button.EMOJI_PICKER_BUTTON]An ordered list of buttons to show in the footer (supports both default buttons and custom components) - for the list of default buttons, import the Button constant from the library.

general

Properties here handle general configurations for the chatbot.

NameTypeDefaultDescription
primaryColorstring"#42b0c5"The primary color for the chatbot's interface.
secondaryColorstring"#491d8d"The secondary color for the chatbot's interface.
fontFamilystring"-apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif"The default font family to be used for the chatbot's text.
showHeaderbooleantrueSpecifies whether the header should be shown in the chat window.
showFooterbooleantrueSpecifies whether the footer should be shown in the chat window.
showInputRowbooleantrueSpecifies whether the chat input row should be shown in the chat window.
actionDisabledIconstring-The cursor image to display when hovering over an action that is disabled.
embeddedbooleanfalseSpecifies whether the chatbot is embedded in the webpage or accessed through a floating button. Note that notifications feature will not work for embedded chat windows.
flowStartTriggerstring"ON_LOAD"The trigger for starting chatbot flow which includes:
  • ON_LOAD:
  • Flow begins on chatbot load
  • ON_CHATBOT_INTERACT:
  • Flow begins when user interacts with chatbot
  • ON_PAGE_INTERACT:
  • Flow begins when user interacts with page

Properties here handle the chat header.

NameTypeDefaultDescription
titlestring | JSX.Element-The title to be displayed in the chatbot header.
showAvatarbooleantrueSpecifies whether the avatar should be displayed in the chatbot header.
avatarstring-Image import or URL for the avatar to be displayed in the chatbot header.
closeChatIconSVGElement | string-SVG element import or image URL for the close chat icon to be displayed in the chatbot header.
buttonsArray<string | JSX.Element>[Button.NOTIFICATION_BUTTON, Button.AUDIO_BUTTON, Button.CLOSE_CHAT_BUTTON]An ordered list of buttons to show in the header (supports both default buttons and custom components) - for the list of default buttons, import the Button constant from the library.

notification

Properties here handle the message notification sent to the user. When toggled on, a notification sound will be played when a message is sent while the chat window is closed or while the user is alt-tab. For embedded chatbots, notification will be played if chatbot is scrolled out of view.

NameTypeDefaultDescription
disabledbooleanfalseSpecifies whether chatbot notifications are disabled.
defaultToggledOnbooleantrueSpecifies whether chatbot notifications are toggled on by default.
volumenumber0.2The volume (between 0 to 1) at which notification sound is played.
notificationSoundstring-The sound to be played for chatbot notifications.
iconSVGElement | string-SVG element import or image URL for the notification icon to be displayed in the chatbot header.
iconDisabledSVGElement | string-SVG element import or image URL for the notification icon to be displayed in the chatbot header when it is disabled.
showCountbooleantrueSpecifies whether unread message count is shown on the top right corner of the chatbot button (this option is ignored if notification is disabled).

sensitiveInput

Properties here handle sensitive chat input sent by the user.

NameTypeDefaultDescription
maskInTextAreabooleantrueSpecifies whether to mask sensitive text with asterisks within the chat input textarea that users type in (if hideInUserBubble is set to true, it will override this option).
maskInUserBubblebooleantrueSpecifies whether to mask sensitive text with asterisks within the user message bubble sent to chat.
asterisksCountnumbertrueSpecifies the number of asterisks used to mask the sensitive text in chat bubbles.
hideInUserBubblebooleantrueSpecifies whether to completely hide user message bubbles containing sensitive text when sent to chat.

toast

Properties here handle toasts shown in the chatbot.

NameTypeDefaultDescription
maxCountnumber3Specifies the maximum number of toasts that can be shown at once.
forbidOnMaxbooleanfalseIf true, new toasts will be prevented from being shown when the max number of toasts has been reached. If false, new toasts will be shown but the oldest toasts beyond the max limit will be removed.
dismissOnClickbooleantrueIf true, clicking on toasts will dismiss them.

tooltip

Properties here handle the tooltip shown beside the chat button.

NameTypeDefaultDescription
modestring"CLOSE"The mode of the tooltip which includes:
  • ALWAYS:
  • Tooltip is always shown
  • CLOSE:
  • Tooltip is shown when chat window is closed
  • START:
  • Tooltip is shown once on page load
  • NEVER:
  • Tooltip is never shown
textstring"Talk to me! 😊"The text to be displayed in the tooltip.

userBubble

Properties here handle the chat bubble for messages sent by the user.

NameTypeDefaultDescription
animatebooleantrueSpecifies whether the user chat bubbles should be animated.
showAvatarbooleanfalseSpecifies whether the avatar should be displayed for user chat bubbles.
avatarstring-Image import or URL for the avatar to be displayed for user chat bubbles.
simStreambooleanfalseSpecifies whether to simulate text messages from the user as a stream.
streamSpeednumber30Specifies the interval in milliseconds between streaming each character (ignored if simStream is false).
dangerouslySetInnerHtmlbooleanfalseSpecifies whether to allow setting of raw HTML content within a user message bubble (if true, do sanitize input strings and use with caution).

voice

Properties here handle the voice to text feature (feature is available only on desktop). Note that this feature will be disabled if chat input is disabled.

NameTypeDefaultDescription
disabledbooleanfalseSpecifies whether chatbot voice is disabled.
defaultToggledOnbooleanfalseSpecifies whether chatbot voice is toggled on by default.
languagestring"en-US"The expected language from the user, set by a string representing a BCP 47 language tag.
timeoutPeriodnumber10000The timeout period in milliseconds for chatbot voice before it automatically toggles off.
autoSendDisabledbooleanfalseSpecifies whether auto-sending of voice messages into the chat is disabled.
autoSendPeriodnumber1000The period in milliseconds after which voice messages are automatically sent.
sendAsAudiobooleanfalseSpecifies whether voice input will be sent as an audio file instead (note that autoSend features will not work if this is true).
iconSVGElement | string-SVG element import or image URL for the voice icon to be displayed in the chatbot interface.
iconDisabledSVGElement | string-SVG element import or image URL for the voice icon to be displayed in the chatbot interface when it is disabled.