Skip to main content

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).

NameTypeDynamicDescription
messagestring | functionYesMessage sent by the bot to the user - if using function, it can be passed params.
optionsarrayNoAn array of options that the bot presents to the user to choose from.
checkboxesobjectNoAn object containing the following 3 properties:
  • items:
  • (required) array of choices that the bot presents to the user to select from.
  • max:
  • (optional) maximum number of allowed selections, defaults to all if not specified
  • min:
  • (optional) minimum number of allowed selections, defaults to 1 if not specified
renderJSX.Element | functionYesCustom component to render in the chat window to the user - if using function, it can be passed params.
chatDisabledbooleanNoBoolean indicating whether chat input is to be enabled or disabled in this block (overrides the chatInput section under Configurations).
isSensitivebooleanNoBoolean indicating whether chat input is sensitive and needs to be masked.
transitionobject | functionYesAn object (or function returning an object) containing the following 2 properties:
  • duration:
  • (required) duration in milliseconds before the post-process attributes of a block are ran (auto-transition)
  • interruptable:
  • (optional) boolean indicating if user input will halt this auto-transition, defaults to false if not specified
If using function, it can be passed params.

Post-processing Attributes

Below is the list of available pre-processing attributes (processed upon user input and before exiting a block).

NameTypeDynamicDescription
functionfunctionYesFunction that runs after a user input (can be passed params)
filefunctionYesFunction that runs after file upload (can be passed params).
pathstring | functionYesPath 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!