You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ React ChatBotify Docs offer the following notable features:
40
40
-**Live Examples:** A slew of examples curated to fit common use cases are present, complete with live editors for experimentation.
41
41
-**API Documentation:** API for the chatbot are clearly documented in tables for easy reference.
42
42
43
-
These features, **along with many others**, help provide a highly robust user guide to aid in the usage of [React ChatBotify](https://react-chatbotify.tjtanjin.com).
43
+
These features, **along with many others**, help provide a highly robust user guide to aid in the usage of [React ChatBotify](https://react-chatbotify.com).
44
44
45
45
### Technologies
46
46
Technologies used by React ChatBotify Docs are as below:
Copy file name to clipboardExpand all lines: docs/api/attributes.md
+16-15
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,13 @@
1
1
---
2
-
sidebar_position: 2
2
+
sidebar_position: 1
3
3
title: Attributes
4
4
description: api documentation for attributes
5
5
keywords: [react, chat, chatbot, chatbotify]
6
6
---
7
7
8
8
# Attributes
9
9
10
-
This page documents all the attributes that may be used in a conversation [**Block**](/docs/introduction/Conversations#block). Note that the 6 dynamic attributes `message`, `render`, `function`, `file`, `transition` and `path` are able to accept [**Params**](/docs/introduction/Conversations#params) as documented [**here**](/docs/api/params). For an example on how to use these attributes, you may refer to the sample flow in the dropdown below.
10
+
This page documents all the attributes that may be used in a conversation [**Block**](/docs/introduction/Conversations#block). Take note that [**Attributes**](/docs/introduction/conversations#attributes) are divided into **pre-processing** and **post-processing** as listed in the tables below. For a brief example on the usage of attributes, you may refer to the **sample flow** in the dropdown which uses `message` and `path`.
11
11
12
12
<details>
13
13
<summary>Click to view sample flow</summary>
@@ -29,24 +29,25 @@ const flow = {
29
29
30
30
Below is the list of available pre-processing attributes (processed upon entering a block and before user input).
| message | string \| function | Yes | Message sent by the bot to the user - if using function, it can be passed `params`. |
35
-
| options | array | No | An array of options that the bot presents to the user to choose from. |
36
-
| checkboxes | object | No | An object containing the following 3 properties: <ul><li>`items`:</li> (required) array of choices that the bot presents to the user to select from.<li>`max`:</li> (optional) maximum number of allowed selections, defaults to `all` if not specified<li>`min`:</li> (optional) minimum number of allowed selections, defaults to `1` if not specified</ul>
37
-
| render | JSX.Element \| function | Yes | Custom component to render in the chat window to the user - if using function, it can be passed `params`. |
38
-
| chatDisabled | boolean | No | Boolean indicating whether chat input is to be enabled or disabled in this block (overrides the `chatInput` section under [**Configurations**](/docs/api/bot_options#chatinput)). |
39
-
| transition | object \| function | Yes | An object (or function returning an object) containing the following 2 properties: <ul><li>`duration`:</li> (required) duration in milliseconds before the post-process attributes of a block are ran (auto-transition)<li>`interruptable`:</li> (optional) boolean indicating if user input will halt this auto-transition, defaults to `false` if not specified</ul> If using function, it can be passed `params`. |
| message | string \| function | Message sent by the bot to the user - if using function, it can be passed `params`. |
35
+
| options | array | An array of options that the bot presents to the user to choose from. |
36
+
| checkboxes | object | An object containing the following 3 properties: <ul><li>`items`:</li> (required) array of choices that the bot presents to the user to select from.<li>`max`:</li> (optional) maximum number of allowed selections, defaults to `all` if not specified<li>`min`:</li> (optional) minimum number of allowed selections, defaults to `1` if not specified</ul> |
37
+
| component | JSX.Element \| function | Custom component to render in the chat window to the user - if using function, it can be passed `params`. |
38
+
| isSensitive | boolean | Boolean indicating whether chat input is sensitive and needs to be masked. |
39
+
| chatDisabled | boolean | Boolean indicating whether chat input is to be enabled or disabled in this block (overrides the `chatInput` section under [**Configurations**](/docs/api/settings#chatinput)). |
40
+
| transition | object \| function | An object (or function returning an object) containing the following 2 properties: <ul><li>`duration`:</li> (required) duration in milliseconds before the post-process attributes of a block are ran (auto-transition)<li>`interruptable`:</li> (optional) boolean indicating if user input will halt this auto-transition, defaults to `false` if not specified</ul> If using function, it can be passed `params`. |
40
41
41
42
## Post-processing Attributes
42
43
43
44
Below is the list of available pre-processing attributes (processed upon user input and before exiting a block).
| userInput | string | All Dynamic Attributes | A string representing the user's input in the chat. |
19
-
| prevPath | string | All Dynamic Attributes | A string representing the previous path in the chat (can be null if not found). |
20
-
| injectMessage | async function | All Dynamic Attributes | A utility function used to inject a message into the chat which takes in 3 properties as represented by the [**Message**](/docs/introduction/conversations#message) type. ||
21
-
| streamMessage | async function | All Dynamic Attributes | A utility function used to stream messages into the chat which takes in 3 properties as represented by the [**Message**](/docs/introduction/conversations#message) type and you may refer to [**this example**](/docs/examples/real_time_stream) for more details. ||
22
-
| openChat | function | All Dynamic Attributes | A utility function used to control the visibility of the chat component. It takes one parameter: <ul><li>`isOpen`:</li> A boolean indicating whether the chat should be opened (`true`) or closed (`false`).</ul> |
18
+
| userInput | string | All Attributes | A string representing the user's input in the chat. |
19
+
| prevPath | string | All Attributes | A string representing the previous path in the chat (can be null if not found). |
20
+
| goToPath | function | All Attributes | A utility function for immediately pathing to another block. |
21
+
| injectMessage | async function | All Attributes | A utility function used to inject a message into the chat which takes in 3 properties as represented by the [**Message**](/docs/introduction/conversations#message) type. ||
22
+
| streamMessage | async function | All Attributes | A utility function used to stream messages into the chat which takes in 3 properties as represented by the [**Message**](/docs/introduction/conversations#message) type and you may refer to [**this example**](/docs/examples/real_time_stream) for more details. ||
23
+
| openChat | function | All Attributes | A utility function used to control the visibility of the chat component. It takes one parameter: <ul><li>`isOpen`:</li> A boolean indicating whether the chat should be opened (`true`) or closed (`false`).</ul> |
23
24
| files | FileList | Only `file` Attribute | A list of file(s) uploaded by the user.
0 commit comments