The Multiselect Listbox component for Retool Apps
An input field to select multiple options from a list.
Refer to the selection input guide for more information on using this component.
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.
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
true
disabledValues
A list of values not available for selection.
Type | array |
Array values | boolean |
Mutability | Read-only |
emptyMessage
The message to display if no value is set.
Type | string | ||||
Mutability |
|
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
labelPosition
The position of the label relative to the input field or value.
Type | string | |||||||||
Format | Plain Text | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
top
labels
A list of labels for each item. Falls back to the corresponding value
if no label is provided.
Type | array |
Array values | string |
Mutability | Read-only |
Default |
|
Examples
["Label 1", "Label 2", "Label 3"]
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
required
Whether a value is required to be selected.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
searchMode
The type of search to perform.
Type | string | ||||||||
Mutability |
| ||||||||
Allowed Values |
|
searchTerm
An optional string to filter the displayed options. Matches values or labels if provided.
Type | string | ||||
Mutability |
|
selectedIndexes
A list of selected values, by index.
Type | array |
Array values | number |
Mutability | Read-only |
Examples
[{"id": "1", "name": "Item 1"}, {"id": "2", "name": "Item 2"}]
selectedLabels
A list of labels for selected values, by index.
Type | array |
Array values | string |
Mutability | Read-only |
showActions
Whether to show a footer that displays selected items and allows users to select and clear all items.
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
showSelectionIndicator
Whether to display an icon next to a selected item.
Type | boolean | ||||
Format | True/False | ||||
Mutability |
| ||||
Default |
|
Examples
true
style
Custom style options.
Type | object | ||||
Mutability |
|
tooltipText
The tooltip text to display next to the label on hover.
Type | string | ||||
Format | Markdown | ||||
Mutability |
| ||||
Default |
|
Examples
Submit
values
A list of possible values from which to select.
Type | array | ||||
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.
multiselectListbox.clearValidation()
Clear the validation message from the input field.
multiselectListbox.clearValidation()
Examples
Clear the validation message from multiselectListbox
.
multiselectListbox.clearValidation();
multiselectListbox.clearValue()
Clear the current values.
multiselectListbox.clearValue()
Examples
Clear the current value of multiselectListbox
.
multiselectListbox.clearValue();
multiselectListbox.focus()
Set focus on the input field.
multiselectListbox.focus()
Examples
Set focus on multiselectListbox
.
multiselectListbox.focus();
multiselectListbox.resetValue()
Reset the current value to the default value.
multiselectListbox.resetValue()
Examples
Reset the current value of multiselectListbox
.
multiselectListbox.resetValue();
multiselectListbox.scrollIntoView()
Scrolls the canvas or parent container so that the selected component appears in the visible area.
multiselectListbox.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 multiselectListbox
into view.
multiselectListbox.scrollIntoView({behavior: 'auto', block: 'nearest'});
multiselectListbox.setDisabled()
Set the disabled
value to toggle whether the input field is disabled. Defaults to true
without a parameter.
multiselectListbox.setDisabled(disabled)
Parameters
disabled
Whether input, interaction, selection, or triggering is disabled.
Type | boolean |
Format | True/False |
Default |
|
Examples
true
Examples
Disable multiselectListbox
.
multiselectListbox.setDisabled(true);
Enable multiselectListbox
.
multiselectListbox.setDisabled(false);
multiselectListbox.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
multiselectListbox.setHidden(hidden)
Parameters
Examples
true
Examples
Hide multiselectListbox
.
multiselectListbox.setHidden(true);
Unhide multiselectListbox
.
multiselectListbox.setHidden(false);
multiselectListbox.setValue()
Set the current value.
multiselectListbox.setValue(value)
Examples
Set the current value of multiselectListbox
to userValue
.
multiselectListbox.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 |
---|---|
Change | The value is changed. |
Clear | A value is cleared. |