list-item
The list-item component serves as the child component whenever any list-related item has been called, as discussed in the jig.list and list sections. The component determines how the list items are returned, allowing you to customize the data returned and add UI elements to the lists.
Core structure | |
title | Add a title for the list-item. You can use an expression and datasource to set the title. The title must fit the line, as the text will not wrap to the next line. |
Other options | |
color | The color of the list item changes based on conditions. The first evaluating to true will be used. |
description | The subtitle or description should be displayed with the list-item title. You can format the text of these properties if you select the "Text With Format" option in the builder help (ctrl + space). |
divider | Set the space between two items in the list.
|
leftElement | Set an element to the left of the list. The following elements are available:
|
progress | Add a colorful visualization (background color of your choice) of the list item's progress. The color displays from left to right, and the range of the allowed values is from 0 to 1. |
rightElement | Set an element to the right of the list. The following elements are available:
|
subtitle | The subtitle or description should be displayed together with the title on the list-item. You can format the text of these properties if you select the Text With Format option in the IntelliSense (ctrl + space). |
Actions | |
onPress | The action is available with the swipeable action and is triggered when pressing an item in the list. Use IntelliSense (ctrl+space) to see the list of available actions. |
swipeable | Use the swipeable property to add the onPress action. The action will appear and become pressable by swiping the list-item to the left or right. |
State Configuration | Key | Notes |
amount checked |
| |
amount checked |
| |
activeItemId now |
|
Examples and code snippets
Simple list
Simple list with dividers
List with colored progress bars
This example showcases two additional properties that have been configured, the progress and colors. You can use the data along with some expressions to manipulate data to create meaningful list displays.
List with charts
List with avatars
This example shows a list of avatars grouped by titles and returns all avatars in the array. In this example, the static datasource has been configured to use the uri and text properties that are required for avatars in a list. This makes it easy to configure in the by simply using the expression: avatars: [email protected]
The following expression can be used if your datasource uses different names for uri and text, for example: avatars: [email protected].{"text":name,"uri":image}[]
Examples: See the full example using static data in GitHub.
List with left avatar
List with left checkboxes
This example showcases a list with checkboxes to the left. This can be configured with preset checked values or can just be empty for the user to select themselves.
Examples: See the full example using static data in GitHub. See the e full example using dynamic data in GitHub.
Specifying initialValue will determine the value when the list is loaded, however, specifying the value presets the value itself. The latter is handy when you want to display details that don't require much intervention from the user or if you wish to make it easier and faster so they only have to review the current selections for instance.
List with the left icons
List with the left image
List with left progress
Swipeable list (left)
This example shows using the swipeable action to access the onPress action as well as setting up a primary and secondary action.
Examples: See the full example using static data in GitHub. See the full example using dynamic data in GitHub.
Datasources: See the full datasource for static data in GitHub. See the full datasource for dynamic data in GitHub.
List with the right amount control
Examples:
See the full example of amount control options in GitHub. See the full example using static data in GitHub. See the full example using dynamic data in GitHub.
Datasources: See the full datasource for static data in GitHub. See the full datasource for dynamic data in GitHub.
List with the right badges
List with right Buttons
List with the right icons
List with the right switch
List with the right value
Swipeable list (right)
This example shows the swipeable action configured to swipe right for each list-item. We show how to set up a primary and secondary action.
Examples:
See the full example using static data in GitHub. See the full example using dynamic data in GitHub.
Datasources: See the full datasource for static data in GitHub. See the full datasource for dynamic data in GitHub.
List with active item
This allows you to see when you are interacting with a specific list-item. Whilst interacting, the list item changes slightly making it clear which item you are interacting with.
Examples: See the full example using static data in GitHub. See the full example using dynamic data in GitHub. Datasources: See the full datasource for static data in GitHub. See the full datasource for dynamic data in GitHub.
List with sections
List items contained in a card (styling)
This example use the isContained property set to true to style each item by wrapping it in a card.
Examples: See the full example in GitHub.