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 |
Configurability | Inspector |
Default | null |
avatarFallback
The text that is displayed when there is no Image URL or icon.
Type | string |
Format | Plain Text |
Configurability | Inspector |
Default | null |
Examples
"Jenny Appleseed"
avatarIcon
The icon that's displayed for the avatar.
Type | string |
Format | Icon Key |
Configurability | Inspector |
Default | null |
Examples
"/icon:bold/user"
avatarSrc
The image URL to use for the avatar.
Type | string |
Format | URL |
Configurability | Inspector |
Default | null |
Examples
"https://example.com/image.jpg"
data
The data.
Type | string | number | boolean | object | array |
Format | Custom data |
Configurability | Inspector |
Default | null |
emptyDescription
The description to display before the first message is sent.
Type | string |
Configurability | Inspector |
Default | null |
emptyTitle
The title to display before the first message is sent.
Type | string |
Configurability | Inspector |
Default | null |
events
A list of configured event handlers that trigger actions or queries.
Type | array |
Array values | object |
Configurability | Inspector > Interaction > Event handlers |
Default | null |
Array Object Properties
event
The event that triggers the action. Refer to the events section for details of available events for this object.
Type | string |
Configurability | Inspector > Interaction > Event handlers > Event |
Default | null |
method
The JavaScript method to perform when type
is datasource
, widget
, state
, or localStorage
.
Type | string |
Configurability | Inspector > Interaction > Event handlers > Edit event handler > Run script actions |
Default | null |
type
The type of action to perform.
Type | string | ||||||||||||||
Configurability | Inspector > Interaction > Event handlers > Edit event handler > Action | ||||||||||||||
Allowed Values |
| ||||||||||||||
Default | null |
hidden
Whether this object is hidden from view.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Hidden |
Default | false |
Examples
true
id
The unique identifier (name).
Type | string |
Format | Plain Text |
Configurability | Inspector |
Default | commentThread1 |
Examples
query1
button1
isHiddenOnDesktop
Whether to show or hide this object in the desktop layout.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Advanced > Show on desktop |
Default | false |
Examples
true
isHiddenOnMobile
Whether to show or hide this object in the mobile layout.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Advanced > Show on mobile |
Default | true |
Examples
true
maintainSpaceWhenHidden
Whether to take up space on the canvas if hidden
is true
.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Advanced > Maintain space when hidden |
Default | false |
Examples
true
margin
The amount of margin to render outside.
Type | string | |||||||||
Format | Plain Text | |||||||||
Configurability | Inspector > Spacing > Margin | |||||||||
Allowed Values |
| |||||||||
Default | 4px 8px |
Examples
4px 8px
placeholder
The text to display within the input field when there is no value.
Type | string |
Format | string |
Configurability | Inspector > Content > Placeholder |
Default | Enter a value |
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 |
Configurability | Inspector |
Default | null |
showInEditor
Whether the component remains visible in the editor if hidden
is true
.
Type | boolean |
Format | True/False |
Configurability | Inspector > Appearance > Advanced > Always show in edit mode |
Default | false |
Examples
true
showTimestamp
Whether to display a timestamp for messages.
Type | array |
Array values | boolean |
Configurability | Inspector |
Default | null |
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 |
Configurability | Inspector |
Default | null |
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(key, 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. |