The Card Collection component for Retool Mobile
A content area to display items in a grid or list.
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.
cardSize
The size of cards to display if cardType
is media
.
Type | string | ||||||
Mutability |
| ||||||
Allowed Values |
|
cardStyle
The card style to use.
Type | string | ||||||
Mutability |
| ||||||
Allowed Values |
|
cardType
The type of cards to display.
Type | string | ||||||
Mutability |
| ||||||
Allowed Values |
|
data
The data.
Type | array | ||||||
Format | Custom data | ||||||
Mutability |
|
hidden
Whether this object is hidden from view.
Type | boolean | ||||||
Format | True/False | ||||||
Mutability |
| ||||||
Default |
|
Examples
true
itemMode
The configuration mode for options.
Type | string | |||||||||
Mutability |
| |||||||||
Allowed Values |
| |||||||||
Default |
|
Examples
"dynamic"
prefixIconByIndex
A list of icons for each item, by index.
Type | array |
Array values | string |
Mutability | Read-only |
Default |
|
Examples
["/icon:bold/shopping-gift", "/icon:bold/interface-user-single", "/icon:bold/interface-align-layers-1"]
prefixIconColorByIndex
A list of icon colors, by index.
Type | array |
Array values | string |
Mutability | Read-only |
Examples
#FF0000
#00FF00
#0000FF
prefixImageFitByIndex
A list of image fit x-settings, by index.
Type | array |
Array values | string |
Mutability | Read-only |
prefixImageShapeByIndex
A list of image shape x-settings, by index.
Type | array |
Array values | string |
Mutability | Read-only |
prefixImageSizeByIndex
A list of image aspect rations, by index.
Type | array |
Array values | string |
Mutability | Read-only |
prefixImageSourceByIndex
A list of image sources, by index.
Type | array |
Array values | string |
Mutability | Read-only |
prefixTypeByIndex
A list of prefix types, by index.
Type | array |
Array values | string |
Mutability | Read-only |
scrollDirection
The direction for which items scroll.
Type | string | ||||||
Mutability |
| ||||||
Allowed Values |
|
Examples
["Value 1", "Value 2"]
selectedItem
The selected item.
Type | string | number | boolean | object | array |
Format | Custom data |
Mutability | Read-only |
Default |
|
Examples
{"id": "1", "name": "Item 1"}
serverPaginated
Whether to use server-side pagination.
Type | boolean | ||||
Mutability |
|
subtitleByIndex
A list of item body text, by index.
Type | array |
Array values | string |
Mutability | Read-only |
subtitleLengthByIndex
A list of maximum lines to display values, by index.
Type | array |
Array values | number |
Mutability | Read-only |
suffixIconByIndex
A list of icons for each item, by index.
Type | array |
Array values | string |
Mutability | Read-only |
Default |
|
Examples
["/icon:bold/shopping-gift", "/icon:bold/interface-user-single", "/icon:bold/interface-align-layers-1"]
suffixTypeByIndex
A list of action types, by index.
Type | array |
Array values | string |
Mutability | Read-only |
suffixValueByIndex
A list of boolean values, by index.
Type | array |
Array values | boolean |
Mutability | Read-only |
Methods
JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.
cardCollection.setHidden()
Set the hidden
value to toggle whether the component is visible. Defaults to true
without a parameter.
cardCollection.setHidden(hidden)
Parameters
hidden
Whether this object is hidden from view.
Examples
Hide cardCollection
.
cardCollection.setHidden(true);
Unhide cardCollection
.
cardCollection.setHidden(false);
cardCollection.setSelectedPageIndex()
Set the selected page index.
cardCollection.setSelectedPageIndex(index)
Parameters
index
The index of an item.
Events
Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.
Event | Description |
---|---|
Button Press | A button is pressed. |
Checkbox Press | A checkbox is pressed. |
Press | An item is pressed. |
Switch Press | A switch is toggled. |