Skip to main content
This page is unlisted and can only be accessed directly via URL. It is excluded from the site navigation and search results.

The List View component for Retool Apps

A list that renders each item from an array of data using a custom-built row of components.

This is a legacy component that is no longer supported. Use the newer version of this component which has more features and functionality.

List View supports unique row keys and displays rows using dynamic or fixed height. Rows can contain any combination of components to customize how data is interacted with or presented.

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.


dynamicHeightsEnabled

Whether list item height is dynamically set.

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

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
legacyListView1
Examples
query1
button1

instances

The number of instances.

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

itemHeight

The height of each item.

Type number
Mutability
ControlUsage
Retool UI Inspector

itemWidth

The width of each item.

Type number
Mutability
ControlUsage
Retool UI Inspector

layoutType

The layout type.

Type string
Mutability
ControlUsage
Retool UI Inspector
Allowed Values
ValueDescription
list

List layout.

grid

Grid layout.


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

numColumns

The number of columns to display.

Type number
Mutability
ControlUsage
Retool UI Inspector

overflowType

The overflow behavior when the contents exceed 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

showBorder

Whether to show a border.

Type boolean
Format True/False
Mutability
ControlUsage
Retool UI Inspector > Appearance > Show border
Default
false
Examples
true

showDropShadow

Whether to show a drop shadow.

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

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.

legacyListView.scrollIntoView()

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

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

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

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