Skip to main content

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.

deprecatedLabels

A list of labels (deprecated).

Type array
Array values string
Mutability Read-only

disabled

Whether input, interaction, selection, or triggering is disabled.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Interaction > Disabled
MethodsetDisabled()
Default
false
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
ControlUsage
Retool UI Inspector > Appearance > Empty state

id

The unique identifier (name).

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector
Default
multiselectListbox1
Examples
query1
button1

isHiddenOnDesktop

Whether to show or hide this object in the desktop layout.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI 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
Mutability
ControlUsage
Retool UI Inspector > Appearance > Advanced > Show on mobile
Default
true
Examples
true

labelPosition

The position of the label relative to the input field or value.

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector > Content > Add-ons > Label > Position
Allowed Values
ValueUI OptionDescription
topTop

Above the input field or value.

leftLeft

Left of the input field or value.

Default
left
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
ControlUsage
Retool UI Inspector > Appearance > Advanced > Maintain space when hidden
Default
false
Examples
true

margin

The amount of margin to render outside.

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector > Spacing > Margin
Allowed Values
ValueUI OptionDescription
4px 8pxNormal

Normal margin.

0None

No margin.

Default
4px 8px
Examples
4px 8px

maxCount

The maximum number of items to allow.

Type number
Mutability
ControlUsage
Retool UI Inspector

minCount

The minimum number of items to allow.

Type number
Mutability
ControlUsage
Retool UI Inspector

required

Whether a value is required to be selected.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Interaction > Validation rules > Required
Default
false
Examples
true

searchMode

The type of search to perform.

Type string
Mutability
ControlUsage
Retool UI Inspector
Allowed Values
ValueDescription
fuzzy

Searches using fuzzy logic.

caseInsensitive

Ignores the case used in search terms.

caseSensitive

Matches the case used in search terms.


searchTerm

An optional string to filter the displayed options. Matches values or labels if provided.

Type string
Mutability
ControlUsage
Retool UI Inspector > Interaction > Search term

selectedIndexes

A list of selected values, by index.

Type array
Array values number
Mutability Read-only

selectedItems

A list of selected items.

Type array
Mutability Read-only
Default
[]
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
ControlUsage
Retool UI Inspector

showInEditor

Whether the component remains visible in the editor if hidden is true.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Advanced > Always show in edit mode
Default
false
Examples
true

showSelectionIndicator

Whether to display an icon next to a selected item.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Advanced > Show selection indicator
Default
true
Examples
true

style

Custom style options.

Type object
Mutability
ControlUsage
Retool UI Inspector > Appearance > style

tooltipText

The tooltip text to display next to the label on hover.

Type string
Format Markdown
Mutability
ControlUsage
Retool UI Inspector > Content > Add-ons > Helper text
Default
null
Examples
Submit

value

A list of selected values.

Type array
Mutability Read-only

values

A list of possible values from which to select.

Type array
Mutability
ControlUsage
Retool UI Inspector

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.

Definition
multiselectListbox.clearValidation()
Examples

Clear the validation message from multiselectListbox.

multiselectListbox.clearValidation();

multiselectListbox.clearValue()

Clear the current values.

Definition
multiselectListbox.clearValue()
Examples

Clear the current value of multiselectListbox.

multiselectListbox.clearValue();

multiselectListbox.focus()

Set focus on the input field.

Definition
multiselectListbox.focus()
Examples

Set focus on multiselectListbox.

multiselectListbox.focus();

multiselectListbox.resetValue()

Reset the current value to the default value.

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

Definition
multiselectListbox.scrollIntoView(options)
Parameters

options

The scroll options.

Type object
Object Properties

behavior

The scroll behavior.

Type string
Allowed Values
ValueDescription
auto

Scroll immediately to the specified position.

smooth

Scroll gradually to the specified position.


block

The scroll position relative to the component.

Type string
Allowed Values
ValueDescription
nearest

Scrolls only the minimum amount required for the component to appear in the visible area. Scrolling does not occur if the component is already in view.

start

Scrolls to position the component at the top of the visible area.

center

Scrolls to position the component in the middle of the visible area.

end

Scrolls to position the component at the bottom of the visible area.



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.

Definition
multiselectListbox.setDisabled(disabled)
Parameters

disabled

Whether input, interaction, selection, or triggering is disabled.

Type boolean
Format True/False
Default
false
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.

Definition
multiselectListbox.setHidden(hidden)
Parameters

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Default
false
Examples
true

Examples

Hide multiselectListbox.

multiselectListbox.setHidden(true);

Unhide multiselectListbox.

multiselectListbox.setHidden(false);

multiselectListbox.setValue()

Set the current value.

Definition
multiselectListbox.setValue(value)
Parameters

value

The value.

Type string | number | boolean | object | array

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.

EventDescription
ChangeThe value is changed.
ClearA value is cleared.