Skip to main content

The List View component for Retool Apps

A repeatable list of components with values that map to a list of data.

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.

data

The data.

Type string | number | boolean | object | array
Format Custom data
Mutability
ControlUsage
Retool UI Inspector
MethodcopyToClipboard()

direction

The layout of content.

Type string
Mutability
ControlUsage
Retool UI Inspector
Allowed Values
ValueDescription
row

Horizontal row layout.

column

Vertical column layout.


enableInstanceValues

Whether to enable instance values. When true, descendent values are evaluated with a formDataKey property for all instances, including those that haven't been evaluated yet due to virtualization. These values are aggregated on the instanceValues property.

Type boolean
Mutability
ControlUsage
Retool UI Inspector

formDataKey

The key used by a Form component to assign default values to input fields using form.initialData, and to construct the form.data property.

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector > Interaction > Form data key
Default
{{ self.id }}
Examples
table1.selectedRow.id

heightType

Whether List View height automatically adjusts to fit content or is a fixed size.

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector > Spacing > Height
Allowed Values
ValueDescription
fixed

Fixed height.

auto

Expand to fit content.

fill

Expand to fill available space.

Default
fixed

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Hidden
MethodsetHidden()
Default
false
Examples
true

id

The unique identifier (name).

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

instanceValues

A list of instance values.

Type array
Mutability Read-only

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

itemWidth

The width of each item.

Type number
Mutability
ControlUsage
Retool UI Inspector

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

maxHeight

The maximum height.

Type number
Mutability
ControlUsage
Retool UI Inspector

numColumns

The number of columns to display.

Type number
Mutability
ControlUsage
Retool UI Inspector

overflowType

The overflow behavior when the contents exceeds the height.

Type string
Mutability
ControlUsage
Retool UI Inspector
Allowed Values
ValueDescription
scroll

Display a scrollbar.

pagination

padding

The amount of padding to render inside.

Type string
Format Plain Text
Mutability
ControlUsage
Retool UI Inspector > Spacing > Padding
Allowed Values
ValueDescription
4px 8px

Normal padding.

0

No padding.

Default
4px 8px
Examples
4px 8px

primaryKeyFieldNameOverride

The primary key to use.

Type string
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

style

Custom style options.

Type object
Mutability
ControlUsage
Retool UI Inspector > Appearance > style

Methods

JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.

listView.clearInstanceValues()

Clear the instance values.

Definition
listView.clearInstanceValues()
Examples

Clear the instance values from listView.

listView.clearInstanceValues();

listView.resetInstanceValues()

Reset the instance values.

Definition
listView.resetInstanceValues()

listView.scrollIntoView()

Scrolls the canvas or parent container so that the selected component appears in the visible area.

Definition
listView.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 listView into view.

listView.scrollIntoView({behavior: 'auto', block: 'nearest'});

listView.scrollToIndex()

Scrolls to a specific row index.

Definition
listView.scrollToIndex(index)
Parameters

index

The index of an item.

Type number


listView.setHidden()

Set the hidden value to toggle whether the component is visible. Defaults to true without a parameter.

Definition
listView.setHidden(hidden)
Parameters

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Default
false
Examples
true

Examples

Hide listView.

listView.setHidden(true);

Unhide listView.

listView.setHidden(false);

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