The Comment Thread component for Retool Apps
An interface to display and enter comments.
For more information about using this component, refer to the Comment Thread guide.
Properties
All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.
autoRefreshInterval
The frequency, in seconds, at which to reload data.
Type | number | ||||
Mutability |
|
avatarFallback
The text that is displayed when there is no Image URL or icon.
Type | string | ||||
Format | Plain Text | ||||
Mutability |
|
Examples
"Jenny Appleseed"
avatarIcon
The icon that's displayed for the avatar.
Type | string | ||||
Format | Icon Key | ||||
Mutability |
|
Examples
"/icon:bold/user"
avatarSrc
The image URL to use for the avatar.
Type | string | ||||
Format | URL | ||||
Mutability |
|
Examples
"https://example.com/image.jpg"
data
The data.
Type | string | number | boolean | object | array | ||||||
Format | Custom data | ||||||
Mutability |
|
disableSubmit
Whether to disable form submission.
Type | boolean | ||||
Mutability |
|
emptyDescription
The description to display before the first message is sent.
Type | string | ||||
Mutability |
|
emptyTitle
The title to display before the first message is sent.
Type | string | ||||
Mutability |
|
hidden
Whether this object is hidden from view.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
true
id
The unique identifier (name).
Type | string | ||||
Format | Plain Text | ||||
Mutability |
| ||||
Default |
|
Examples
query1
button1
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
4px 8px
placeholder
The text to display within the input field when there is no value.
Type | string | ||||
Format | string | ||||
Mutability |
| ||||
Default |
|
Examples
Enter a value
showEmptyState
Whether to display an empty state before a message is sent. Enabled by adding the Empty state add-on.
Type | boolean | ||||
Mutability |
|
showInEditor
Whether the component remains visible in the editor if hidden
is true
.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
showTimestamp
Whether to display a timestamp for messages.
Type | array | ||||
Array values | boolean | ||||
Mutability |
|
style
Custom style options.
Type | object | ||||
Mutability |
|
threadId
The ID with which to record comments. You can reference dynamic values, such as table1.selectedRow.id
, to switch between comment threads automatically.
Type | string | ||||
Mutability |
|
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
commentThread.clearValue()
Clear the current values.
commentThread.clearValue()
Examples
Clear the current value of commentThread
.
commentThread.clearValue();
commentThread.exportData()
Exports data as a file in a CSV, TSV, JSON, or Excel format.
commentThread.exportData(options)
commentThread.resetValue()
Reset the current value to the default value.
commentThread.resetValue()
Examples
Reset the current value of commentThread
.
commentThread.resetValue();
commentThread.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
commentThread.scrollIntoView(options)
Parameters
Object Properties
behavior
The scroll behavior.
Type | string | ||||||
Allowed Values |
|
block
The scroll position relative to the component.
Type | string | ||||||||||
Allowed Values |
|
Examples
Scroll the minimum amount to immediately bring commentThread
into view.
commentThread.scrollIntoView({behavior: 'auto', block: 'nearest'});
commentThread.sendMessage()
Send the current message.
commentThread.sendMessage()
commentThread.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
commentThread.setHidden(hidden)
Parameters
Examples
true
Examples
Hide commentThread
.
commentThread.setHidden(true);
Unhide commentThread
.
commentThread.setHidden(false);
commentThread.setValue()
Set the current value.
commentThread.setValue(value)
Examples
Set the current value of commentThread
to userValue
.
commentThread.setValue(userValue);
Events
Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.
Event | Description |
---|---|
Click Action | An action button is clicked or pressed. |
Submit | The value is submitted. |