Skip to main content

List View

Rocket 2.0

The List View component shows a list or grid of records, such as people, orders or products, and lets users select one. Each item is built from data fields, or from components designed once and repeated for every record.

Properties​

Property
Description
Expected Value
List dataThe records to list, for example {{queries.getItems.data}}.Array
LayoutWhether items appear in a single-column list or a grid.list, grid. Default: list
Grid columnsNumber of columns when Layout is grid.Number. Default: 3
Item contentWhat each item shows. Fields builds the item from the field properties below; Components builds the item from components that read the record as {{listItem}}.Fields, Components. Default: Fields
Item height (px)Height of each item when Item content is Components. An item grows to fit its components.Number. Default: 72
Gap between items (px)Space between items in pixels.Number. Default: 8
Title fieldThe field shown as the item's title.Text. Default: name
Subtitle fieldThe field shown under the title. Leave empty to hide it.Text. Default: email
Avatar field (image URL or a name)The field used for the avatar. An image URL shows the image; any other text shows its initials. Without a value, the title's initials are used.Text. Default: image
Show avatarShows an avatar at the start of each item.On or off. Default: On
Badge field (a chip toned by its words)The field shown as a chip on the right of the item, colored by its text. Leave empty to hide it.Text. Default: role
Right-side fieldA field shown as text on the right of the item, such as a date or amount.Text
Action button label (empty hides it)Label of a button on each item. Leave empty to hide the button.Text. Default: View
Id field (for selection across data changes)The field that identifies each record. It keeps the right item selected when the data changes and is used by Select item.Text. Default: id
Dividers between items (list)Draws a line between items in a list. It has no effect on outlined items or the grid.On or off. Default: Off
Highlight selected itemHighlights the item the user selected.On or off. Default: On
PaginationSplits the list into pages with controls at the bottom.On or off. Default: Off
Items per pageNumber of items on each page when Pagination is on.Number. Default: 10
Server-side pagination (data is one page)Treats List data as a single page loaded by a query. Use On page changed and the page index to fetch the next page.On or off. Default: Off
Total items (server-side)Total number of records across all pages when Server-side pagination is on, used to show the page count.Number. Default: 0
Empty messageText shown when there are no items.Text. Default: No items
Loading lookWhat shows while the component is loading: a Spinner or a Skeleton outline of the list.Spinner, Skeleton. Default: Spinner

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 record clickedTriggers when the user clicks an item.
On page changedTriggers when the user moves to another page.
On action clickedTriggers when the user clicks an item's action button. The item is selected first, so the handler can read it.

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 item whose id matches Item id and scrolls to it, moving to its page if needed. It does not fire On record clicked.components.listview1.selectItem("")
Clear selectionClears the selected item.components.listview1.clearSelection()
Set pageMoves to the given Page without firing On page changed.components.listview1.setPage("")
Set visibilityShows the component when true, hides it when false.components.listview1.setVisibility(false)
Set disableDisables the component when true, enables it when false.components.listview1.setDisable(false)
Set loadingTurns the loading state on with true, off with false.components.listview1.setLoading(false)

Exposed Variables​

Variable
Description
How To Access
dataThe records to list, for example {{queries.getItems.data}}.{{components.listview1.data}}
modeWhether items appear in a single-column list or a grid.{{components.listview1.mode}}
columnsNumber of columns when Layout is grid.{{components.listview1.columns}}
itemContentWhat each item shows. Fields builds the item from the field properties below; Components builds the item from components that read the record as {{listItem}}.{{components.listview1.itemContent}}
rowHeightHeight of each item when Item content is Components. An item grows to fit its components.{{components.listview1.rowHeight}}
gapSpace between items in pixels.{{components.listview1.gap}}
titleFieldThe field shown as the item's title.{{components.listview1.titleField}}
subtitleFieldThe field shown under the title. Leave empty to hide it.{{components.listview1.subtitleField}}
imageFieldThe field used for the avatar. An image URL shows the image; any other text shows its initials. Without a value, the title's initials are used.{{components.listview1.imageField}}
showAvatarShows an avatar at the start of each item.{{components.listview1.showAvatar}}
badgeFieldThe field shown as a chip on the right of the item, colored by its text. Leave empty to hide it.{{components.listview1.badgeField}}
metaFieldA field shown as text on the right of the item, such as a date or amount.{{components.listview1.metaField}}
actionLabelLabel of a button on each item. Leave empty to hide the button.{{components.listview1.actionLabel}}
idFieldThe field that identifies each record. It keeps the right item selected when the data changes and is used by Select item.{{components.listview1.idField}}
showBorderDraws a line between items in a list. It has no effect on outlined items or the grid.{{components.listview1.showBorder}}
highlightSelectedRowHighlights the item the user selected.{{components.listview1.highlightSelectedRow}}
enablePaginationSplits the list into pages with controls at the bottom.{{components.listview1.enablePagination}}
rowsPerPageNumber of items on each page when Pagination is on.{{components.listview1.rowsPerPage}}
serverSidePaginationTreats List data as a single page loaded by a query. Use On page changed and the page index to fetch the next page.{{components.listview1.serverSidePagination}}
totalRecordsTotal number of records across all pages when Server-side pagination is on, used to show the page count.{{components.listview1.totalRecords}}
emptyTextText shown when there are no items.{{components.listview1.emptyText}}
loadingIndicatorWhat shows while the component is loading: a Spinner or a Skeleton outline of the list.{{components.listview1.loadingIndicator}}
selectedItemIdThe id field value of the selected item.{{components.listview1.selectedItemId}}
selectedItemThe record of the selected item.{{components.listview1.selectedItem}}
selectedRecordThe record of the selected item, the same as selectedItem.{{components.listview1.selectedRecord}}
selectedRecordIdThe position of the selected item on its page, starting from 0, or -1 when nothing is selected.{{components.listview1.selectedRecordId}}
pageIndexThe current page number, starting from 1.{{components.listview1.pageIndex}}
isVisibleWhether the component is visible.{{components.listview1.isVisible}}
isLoadingWhether the component is in its loading state.{{components.listview1.isLoading}}
isDisabledWhether the component is disabled.{{components.listview1.isDisabled}}

Styles​

Style
Default
Accent (selected outline, pagination)Theme: Brand primary
List backgroundtransparent
Item backgroundTheme: Surface 1
Item hover backgroundTheme: Surface 3
Selected item backgroundTheme: Brand primary
Item border colorTheme: Default border
Divider colorTheme: Default border
Item radius—
Item lookOutlined card
Item shadowNone
Padding around the list (px)0
Empty message colorTheme: Placeholder text
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.