Skip to main content

List

Ant Design

The List component shows records as rows, each with a title, a description and optional avatar and tag, or as rows of custom components. Use it for feeds, notifications or any list users pick an item from.

Properties​

Property
Description
Expected Value
Data sourceThe records to show, usually a query's data, one row per record.Array
Render itemWhat each row shows. meta shows the fields set below; components repeats the components placed in the first row for every record, which read the record as {{listItem}}.Fields (List.Item.Meta), Components. Default: Fields (List.Item.Meta)
Title fieldField shown as each row's title.Text. Default: title
Description fieldField shown under the title.Text. Default: description
Avatar fieldField shown as an avatar at the left. An image URL shows the picture; other text shows its first letter.Text
Extra fieldField shown at the right of the row, such as an amount or a date.Text
Badge fieldField shown as a colored tag at the right. Common status words such as Paid or Overdue get matching colors.Text
Row height (px)Height of each row when Render item is components, in pixels.Number. Default: 64
Row keyField that identifies each record, used for the selected item and the Select item action.Text. Default: id
HeaderText shown above the list.Text
FooterText shown below the list.Text
BorderedDraws a border around the list.On or off. Default: On
SplitDraws a line between rows.On or off. Default: On
SizePadding of each row.default, small, large. Default: default
Page sizeNumber of rows per page, with page controls under the list. Leave it at 0 to show every row.Number. Default: 0
Empty textMessage shown when there are no records.Text. Default: No data

Additional Actions​

Each of these can be switched on or off, or set with a logical expression by clicking fx.

Property
Description
Expected Value
VisibilityShows or hides the component. Hidden components keep their space unless Collapse when hidden is on.On or off. Default: On
Collapse when hiddenRemoves the hidden component's space, so the components below it move up.On or off. Default: Off
Loading stateShows the component's loading look and blocks interaction, for example while a query runs.On or off. Default: Off
DisableStops the user from interacting with the component.On or off. Default: Off
Dynamic heightLets the component grow with its content in the running app instead of keeping a fixed height.On or off. Default: Off

Devices​

Property
Description
Expected Value
Show on desktopShows the component in the desktop layout.On or off. Default: On
Show on mobileShows the component in the mobile layout.On or off. Default: Off

Events​

Add a handler from the Events section of the properties panel. See Event Triggers for the steps.

Event
Description
On item clickTriggers when the user clicks a row.

Component Specific Actions (CSA)​

Run these from an event handler with Control Component, or from a RunJS query. See Component Specific Actions.

Action
Description
How To Access
Select itemSelects the row whose Row key field matches the given value and moves to its page. It doesn't fire On item click.components.list1.selectItem("")
Clear selectionClears the selected row.components.list1.clearSelection()
Set visibilityShows the component when true, hides it when false.components.list1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.list1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.list1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
dataSourceThe records to show, usually a query's data, one row per record.{{components.list1.dataSource}}
renderItemWhat each row shows. meta shows the fields set below; components repeats the components placed in the first row for every record, which read the record as {{listItem}}.{{components.list1.renderItem}}
titleFieldField shown as each row's title.{{components.list1.titleField}}
descriptionFieldField shown under the title.{{components.list1.descriptionField}}
avatarFieldField shown as an avatar at the left. An image URL shows the picture; other text shows its first letter.{{components.list1.avatarField}}
extraFieldField shown at the right of the row, such as an amount or a date.{{components.list1.extraField}}
badgeFieldField shown as a colored tag at the right. Common status words such as Paid or Overdue get matching colors.{{components.list1.badgeField}}
rowHeightHeight of each row when Render item is components, in pixels.{{components.list1.rowHeight}}
rowKeyField that identifies each record, used for the selected item and the Select item action.{{components.list1.rowKey}}
headerText shown above the list.{{components.list1.header}}
footerText shown below the list.{{components.list1.footer}}
borderedDraws a border around the list.{{components.list1.bordered}}
splitDraws a line between rows.{{components.list1.split}}
sizePadding of each row.{{components.list1.size}}
pageSizeNumber of rows per page, with page controls under the list. Leave it at 0 to show every row.{{components.list1.pageSize}}
emptyTextMessage shown when there are no records.{{components.list1.emptyText}}
selectedItemThe record of the selected row. It is empty when nothing is selected.{{components.list1.selectedItem}}
selectedItemKeyValue of Row key for the selected row.{{components.list1.selectedItemKey}}
isVisibleWhether the component is visible.{{components.list1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.list1.isLoading}}
isDisabledWhether the component is disabled.{{components.list1.isDisabled}}

Styles​

Style
Default
Primary colorTheme: Brand primary
Text colorTheme: Primary text
Container backgroundTheme: Surface 1
Border colorTheme: Default border
Border radius—
Box shadow0px 0px 0px 0px #00000040

A default that starts with Theme: follows the app's theme until the style is set to another value. See App Themes.