Attributes
This page documents all the attributes that may be used in a conversation Block. Note that the 6 dynamic attributes message
, render
, function
, file
, transition
and path
are able to accept Params as documented here. For an example on how to use these attributes, you may refer to the sample flow in the dropdown below.
Click to view sample flow
const flow = {
start: {
message: "Hello there! What is your name?",
path: "ask_age",
},
ask_age: {
message: (params) => `Good to see you ${params.userInput}, how old are you?`
}
}
Pre-processing Attributes
Below is the list of available pre-processing attributes (processed upon entering a block and before user input).
Name | Type | Dynamic | Description |
---|---|---|---|
message | string | function | Yes | Message sent by the bot to the user - if using function, it can be passed params . |
options | array | No | An array of options that the bot presents to the user to choose from. |
checkboxes | object | No | An object containing the following 3 properties:
all if not specified1 if not specified |
render | JSX.Element | function | Yes | Custom component to render in the chat window to the user - if using function, it can be passed params . |
chatDisabled | boolean | No | Boolean indicating whether chat input is to be enabled or disabled in this block (overrides the chatInput section under Configurations). |
isSensitive | boolean | No | Boolean indicating whether chat input is sensitive and needs to be masked. |
transition | object | function | Yes | An object (or function returning an object) containing the following 2 properties:
false if not specifiedparams . |
Post-processing Attributes
Below is the list of available pre-processing attributes (processed upon user input and before exiting a block).
Name | Type | Dynamic | Description |
---|---|---|---|
function | function | Yes | Function that runs after a user input (can be passed params ) |
file | function | Yes | Function that runs after file upload (can be passed params ). |
path | string | function | Yes | Path to navigate to after processing this block - if using function, it can be passed params . |
Tip
There are multiple ways to achieve the same flow/interactions you wish to have for your users. Find the one most intuitive to you or that you are most comfortable with!