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.

Configuration options

Some properties are common to all components, see Common component properties for a list and their configuration options.

Core structure

title

Add a title for the list-item. You can use an expression and datasource to set the title. Select Line Options (text), allowing configuration of individual parts of the central element in a list-item. You can set properties such as color, fontSize, bold, format, isSubtle (low opacity), and numberOfLines, rather than applying them globally via the root.

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) or select Line Options (text), allowing configuration of individual parts of the central element in a list-item. You can set properties such as color, fontSize, bold, format, isSubtle (low opacity), and numberOfLines, rather than applying them globally via the root. select .

divider

Set the space between two items in the list.

  • none - No divider is shown between items. Set by default.

  • transparent - Sets a 1pt margin between two items.

  • solid - Displays a colored line between two items. When the list-item is contained in a card, this property will be ignored.

hasDynamicHeight

The hasDynamicHeight property for vertical lists. When used with the numberOfLines property, list item heights are calculated dynamically based on content. If not combined, items display as a single line. Note: Using hasDynamicHeight with many items may cause performance issues.

isContained

Used to style the list item, true wraps the list item in a card, while false displays the item with no styling. This property can be used with vertical and horizontal lists.

leftElement

Set an element to the left of the list. The following elements are available:

  • avatar - configure the color, size, text, uri, and onPress event.

  • checkbox

  • icon - the icon size, color,shape, type, isSubtle (low opacity), and onPress event is configurable.

  • image - the image size, shape, resizeMode, and onPress event is configurable.

  • progress

numberOfLines

Specify the maximum number of lines for the description and subtitle properties at a global root level. Property values are:

  • dynamic- displays all lines of text.

  • Numerical value (e.g., 2) - Limits the description and subtitle to the specified number of lines.

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.

rating

Displays a rating as either a numerical value or a percentage. This property is highly flexible, with options to configure the ratingIcon, color, and accompanying descriptive text. By default, the rating property has only one icon showing a rating-star in the primary color. value- Rating with numerical value. The value of the rating, which can be a simple number. The number of icons is calculated based on this value unless overridden in the icon configuration. Configuring the current and maximum values, shows the value as a fraction, for example 7/10. percentage - Rating with a percentage. The percentage value for the rating, where the value ranges between 0 and 1, for example 0.75 is 75%. ratingIcon - By default the rating-star icon in the primary color is displayed. icon - Add an icon to represent the rating. A list of icons is available. See for more information. color- Sets the color of the icon, choose a color from the provided color palette. Default color is primary if the property is not specified in the YAML. See the list of available colors in . current and maximum values - Where maximum is the number of icons to display and current the number of icons to color. text - Add a descriptive text that displays next to the rating. Ratings can set up in the following ways: 1) Example of value for a product rating. 2) Example of a user rating shown in a percentage. 3)Example of value rating showing 2.5/5 as a rating with single star icon.

rightElement

Set an element to the right of the list. The following elements are available:

  • amountControl

  • badge - can be a solid colored badge or a badge with a number in it. Badges always use the primary color.

  • button

  • checkbox

  • icon - the icon size, color,shape, type, isSubtle (low opacity), and onPress event is configurable.

  • switch

  • value - When using text, the option to change its color is available.

  • text - define up to three lines of text with styling (color, bold, font size) applied to each line of text.

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) or select Line Options (text), allowing configuration of individual parts of the central element in a list-item. You can set properties such as color, fontSize, bold, format, isSubtle (low opacity), and numberOfLines, rather than applying them globally via the root.

tags

A set of descriptive keywords appear at the bottom of each list item, helping to categorize and provide context. Unlike labels, multiple tags can be shown. Tags support up to two lines; if the tags exceed this space, a +1 indicator is added to represent the number of hidden tags. For example, if two tags are hidden, +2 will display at the end of the list.

  • text - The text content displayed within the tag.

  • color - Sets the color of the tags, choose a color from the provided color palette. The default is primary. See the list of available colors in.

Tags can be set up in three ways:

  1. Using a dynamic expression from a datasource: tags: [email protected][product = @ctx.current.item.id].{"text":tags, "color":color}

  2. Using a dynamic expression from a list item: tags: [email protected].{"text":$, "color":"primary"}

  3. Using static, predefined tags tags: - text: [email protected] > 0.75 ? 'Great'

rating:
   value: 4.5
   text: based on 1,200 reviews

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

Applies to a list, list.item, product-item, and stage components. List's data is an array of records. The [email protected] is the state of the current object in the array.

amount checked

State is the variable of the component.

activeItemId now

Global state variable that can be used throughout the solution.

Considerations

  • You can use a list-item outside of the list component. This allows configuring a single list item with all list-item features, such as left and right elements and swipe actions, without requiring a full list. These items typically use static values rather than a datasource. See the List-item outside a list code example below. The functionality is available in the following components:

Examples and code snippets

Simple list

Simple list
Simple list

This example displays the list in its most basic form, with a few additional properties or elements to support layout and data visibility.

Examples: See the full example using static data localarrow-up-right and globalarrow-up-right in GitHub. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right.

Simple list with dividers

Simple list Simple list with dividers
Simple list Simple list with dividers

This example shows only a slight variation from the previous example, by having a divider : solid properly configured.

Examples: See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right.

List with colored progress bars

List with colored progress
List with colored progress

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.

Examples: See the full example using static data in GitHub. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right.

List with charts

List with pie charts
List with pie charts

This example shows pie charts displayed on a list - this is great for a visual representation of information.

Pie chart examples: See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right.

List with bar charts
List with bar charts

This example shows bar charts displayed on a list as a visual representation of information.

Bar chart example: See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right.

List with avatars

List with avatars
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 jig 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 GitHubarrow-up-right.

List with left avatar

List with avatars (left)
List with avatars (left)

This example showcases the list of items with a regular sized avatar to the left. The title text is styled (bold). The subtitle allows the text to wrap over three lines.

Examples: See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right.

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. A color is added to the title text and the subtitle allows the text to wrap over two lines.

Examples: See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHub See the full datasource for dynamic data in GitHubarrow-up-right.

circle-info

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 checkboxes
List with checkboxes

List with the left icons

List with icons
List with icons

This example displays icons to the left of the list.

Examples: See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right.

List with the left image

List with image
List with image

This example displays a list with an image to left of the list-item for visual representation. The image shape and size is defined.

Examples: See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right.

List with left progress

List with progress
List with progress

This example displays a list with visual progress elements to the left of the list items.

Examples: See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right

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 GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in <GitHubarrow-up-right.

List with the right amount control

List with amountControl
List with amount control

Examples:

See the full example of amount control options in GitHubarrow-up-right. See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right.

List with the right badges

List-item with right badge"
List-item with right badge"

This example shows badges that are displayed based on certain input. Badges always use the primary color. You cannot change the color of the badge. The styling has been applied to the title and subtitle, and each list-item displayed in a container.

Examples: See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources:

See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHub.

List with right numbered badges

In this example a list shows the work priorities and how many tasks there are for each priority. The rightElement uses a badge with an expression. The count is performed in the datasource query rather than in the expression. The expression calls the taskCount from the datasource. Badges always use the primary color. You cannot change the color of the badge.

Examples: See the example in GitHubarrow-up-right.

List-item with numbered badge
List-item with numbered badge

List with right Buttons

List-item with button
List-item with button

This example shows a list with actionable buttons, a bold title, and the subtitle wraps over two lines.

Examples: See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right.

List with the right icons

List-item with right icons
List-item with right icons

This example shows icons to the right of the list-items.

Examples: See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right.

List with the right switch

List-item with switch
List-item with switch

This example displays a list with switches/toggle functionality - based on a certain input.

Examples: See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right.

List with the right value

List-item with right values
List-item with right values

This example shows the right values on a list populated dynamically based on input, and additional configuration using expressions were used to concatenate values. Each list item isContained with bold title, subtitle wrapping over two lines.

Examples: See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right.

Swipeable list (right)

This example demonstrates a swipeable action configured to swipe right on each list item, using both primary and secondary actions. The title, subtitle, and left and right elements are styled with properties such as color, bold text, and number of lines.

Examples: See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right.

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 GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right. See the full datasource for dynamic data in GitHubarrow-up-right.

List with active item
List with active item

List with sections

List with sections
List with sections

This functionality allows you to divide your list into meaningful sections. In this example, there are two sections—one including materials and the other excluding them. Each list-item is contained, with the subtitle wrapping over two lines. A label on the right displays the duration of the job in hours and minutes.

Examples: See the full example using static data in GitHubarrow-up-right. See the full example using dynamic data in GitHubarrow-up-right.

Datasources: See the full datasource for static data in GitHubarrow-up-right.

List items contained in a card

This example use the isContained property set to true to style each item by wrapping it in a card. The code sample below is for a vertical list. You can also wrap list items in a card for a horizontal list.

Examples: See the full example in GitHubarrow-up-right.

List-item contained in a card
List-item contained in a card

List-item with ratings as a value

This example uses the basic rating configuration to display a value with accompanying text. By default, the rating shows a single star in the primary color

Examples: See the full example in GitHubarrow-up-right.

List-item with rating - value
List-item with rating - value

List-item with ratings as a percentage

This example uses the simplest configuration of the rating property to display a percentage. By default the rating shows a star in the primary color.

Examples: See the full example in GitHubarrow-up-right.

List-item with percentage rating
List-item with percentage rating

List-item with ratings with a percentage, minimum, maximum and icon

This example sets up a product review jig that displays:

  • A rating as a percentage.

  • An icon and color customized to represent the rating percentage visually.

  • A styled list where each item is displayed within a card format, achieved by enabling the isContained property.

  • A verified label placed on the right side of the item.

  • A product image shown as an avatar on the left side.

Examples: See the full example in GitHubarrow-up-right.

List-item with customized percentage rating
List-item with customized percentage rating

List-item with multiple tags

This example creates a list with multiple tags shown on each list-item

  • A styled list where each item is displayed within a card format, achieved by enabling the isContained property.

  • The tags show the assigned team, priority, and status.

  • A product image shown as an avatar on the left side.

Examples: See the full example in GitHubarrow-up-right.

List-item with multiple tags
List-item with multiple tags

List-item with ratings and tags

List-item with rating, tags & badges
List-item with rating, tags & badges

This example show a list of cleaning services that displays:

  • A rating as a value.

  • An icon and color customized to represent the rating value visually.

  • Multiple tags showing the hourly rate and cleaning area category.

  • A styled list where each item is displayed within a card format, achieved by enabling the isContained property.

  • A numbered badge in the rightElement of the item shows the number of services available.

Examples: See the full example in GitHubarrow-up-right.

List-item outside a list

In this example, a single list-item is configured inside an expander component. The list-item uses a static value and is configured to use the left and right element as well as the swipeable event that opens an info-modal. Note, that the list-item is outside of a list component and uses a static value and does not rely on a datasource.

List-item outside a list
List-item outside a list

List-item with multiple lines in right element

List-item with multiple lines in right element
List-item with multiple lines in right element

This example demonstrates list-items configured to display data across multiple lines, with styling applied to the title, subtitle, and the left and right elements.

Example:

See the full example in GitHub

See also

Last updated

Was this helpful?