For the complete documentation index, see llms.txt. This page is also available as Markdown.

product-item

The product-item component is a versatile display element designed to render rich product information within a list component or list jig. It offers enhanced visual flexibility, allowing you to choose between a standard default row view or a modern card mode to best suit your design needs. With added support for multi-column layouts, the product-item enables dynamic and responsive product grids, making it ideal for e-commerce catalogs, inventory lists, and digital menus.

Product-item preview
Product-item preview

Configuration options

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

Core structure

title

Add a title for the product-item. You can use an expression and datasource to set the title.

type

The layout type of the product-item. Choose between the default list layout, or a card-based layout. The default type is set to the default layout.

  • default - The classic list row style. Best for dense lists where vertical space is at a premium.

  • card - A boxed, card-style presentation with elevation. Best for emphasizing individual items, especially when used with column layouts.

Other options

amountControl

This property has several setup options:

  • initialValue - Initial value of amount control, for example, 1

  • minimum - Limits the minimum number to be selected. Default is 0.

  • maximum - Limits the maximum number to be selected.

  • onChange - Configure the action that is triggered when value is changed.

  • OnDelete - When this property is set, the trash symbol is displayed when the value is 1 or (min + 1).

  • step - Step for increment/decrement, for example, increments in 2 or 5. Default is 1.

  • style - Enable or disable the amount control, useful if you have only one amount that can be ordered, disable the ability to increase or decrease the amount.

description

A description for the product-item. You can wrap lines based on the numberOfLines property. Text that can be evaluated, translated, and formatted.

discount

This allows you to display the discount price including the currency. Set the discount in the range 0 - 1 (1 = 100%). Discount is set in float format e.g. 0.12.

image

The option to add an image of your product by providing the uri

numberOfColumns

Sets the number of columns used to display items in a multi-column layout. This applies only to vertical lists; it is ignored when isHorizontal is true. This property is set under the data property.

price

This allows you to display the product's base price, including the currency, using the format properties. The default color hierarchy for pricing.

  • Current price is rendered in red.

  • The discounted amount is rendered in black.

style

isWaitingSync - Displays a Waiting sync indicator.

subtitle

Second line of text. It is a single line that does not wrap. The

text can be evaluated, translated, and formatted.

tags

The option to add tags to your item. Add a tag or multiple tags, for example, the maximum amount. The tag can be configured with an expression to determine when it should be displayed. tags:

- text: =@ctx.current.state.amount =10 ? 'max amount':'' color: primary - text: =@ctx.current.item.stock color: warning

Actions

onPress

The action is triggered while pressing on a product item in the list. Use IntelliSense (ctrl+space) to see the list of available actions.

State Configuration
Key
Notes

=@ctx.current.state.

amount

Applies to a list, list.item, product-item, and stage components. List's data is an array of records. The =@ctx.current.state is the state of the current object in the array.

=@ctx.component.state.

amount

State is the variable of the component.

=@ctx.solution.state.

activeItemId now

Global state variable that can be used throughout the solution.

Considerations

  • The recommended maximum number of columns is 3 on mobile devices and 5 on tablets in landscape for optimal readability and spacing.

  • When using an image in the leftElement together with numberOfColumns, the image may expand to fill the entire column, causing the title or subtitle to be hidden.

    • For phones, use an avatar with the image to ensure proper rendering.

    • For tablets, using the image property is supported and renders correctly.

  • Decimal formatting must now be handled in your data or expressions. Ensure values are formatted (e.g., 2 decimal places) to avoid alignment issues in the UI.

Examples and code snippets

Default product-item with tags

In this example, a list containing the default product-item component is shown. Each product contains a title, tags, image, and price. The discount property calculates the price after the discount.

Examples: See the full example using dynamic data in GitHub.

Product-item with tags
Default product-item with tags
Product-item
Product-item

In this example, a list containing the default product-item component is shown. Each product contains a title, tags, image, amountControl, and price. The added advantage is that you can search the list making it suitable for a larger number of products. The discount property calculates the price after the discount.

Examples: See the full example using dynamic data in GitHub.

Default product-item with summary

In this example, a list containing the default product-item component is shown. Each product contains a title, image, and price. The discount property calculates the price after the discount. The summary component at the bottom shows the total of items selected in the amountControl.

Examples: See the full example in GitHub.

Product-item with summary
Product-item with summary

Default product-item in columns

In this example, a list containing the default product-item component is shown in a 2-column (numberOfColumns) layout. Each product contains a title, tags, image, and price. The discount property calculates the price after the discount.

Examples: See the full example in GitHub.

Card product-item with tags

In this example, a list containing the card product-item component is shown. Each product contains a title, tags, image, and price. The discount property calculates the price after the discount.

Examples: See the full example in GitHub.

Product-item card layout with tags
Product-item card layout with tags

Card product-item in columns with tags

Product-item with tags in cards and columns
Product-item with tags in cards and columns

In this example, a list containing the card product-item component is shown in a 2-column (numberOfColumns) layout. Each product contains a title, tag, image, and price. The discount property calculates the price after the discount.

Card product-item in columns with tags & summary

In this example, a list containing the card product-item component is shown in a 2-column (numberOfColumns) layout. Each product contains a title, tag, image, and price. The discount property calculates the price after the discount. An amountControl allows the selection of items and adds them to the cart (summary) at the bottom of the screen.

Examples: See the full example in GitHub.

Product-items in cards, columns, amount control and a summary
Product-items in cards, columns, amount control and a summary

Card product-item in columns in tabs

Product-item in cards, columns in tabs
Product-item in cards, columns in tabs

In this example, a list containing the card product-item component is shown in a 2-column (numberOfColumns) layout. The list is referenced in a jig.tab and uses inputs to display each category in each tab. Each product contains a title, tag, image, and price. The discount property calculates the price after the discount. An amountControl allows the selection of items and adds them to the cart (summary) at the bottom of the screen.

Examples: See the full example in GitHub.

Card product-item in columns with menu-item

In this example, a list uses the menu-item component to show categories in a store. The category state is set with an onPress event. The state is used in the second list's when property to display the corresponding category's card product-item component shown in a 2-column (numberOfColumns) layout. The list uses inputs to display each category in each tab. Each product contains a title, tag, image, and price. The discount property calculates the price after the discount. An amountControl allows the selection of items and adds them to the cart (summary) at the bottom of the screen.

Examples: See the full example in GitHub.

Product-item with menu-item
Product-item with menu-item

See also

Last updated

Was this helpful?