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

amount-control

The amount-control provides a simple and intuitive way to adjust numeric values using plus and minus buttons. It’s ideal for shopping carts, quantity selectors, and any form where values need to increase or decrease in defined steps. The control supports configurable minimum and maximum values, custom step increments, and can also trigger a change or delete action when the value is changed giving you full flexibility for managing item quantities in your apps.

Configuration options

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

Core structure

instanceId

The instanceId is a unique identifier assigned to the amount-control component. It allows other parts of the app—such as functions, actions, or conditional logic to reference this specific component. By using the instanceId, you can programmatically control when the amount-control is shown or hidden, update its content dynamically, or trigger interactions tied to that particular instance. This ensures that each amount-control can be distinctly managed, even when multiple amount-controls are present on the same screen.

when

The when property controls the visibility of the component by evaluating a condition. When the condition resolves to true, the component is displayed; when it resolves to false, the component is hidden. This allows you to show or hide the component dynamically based on expressions, data values, or user interactions.

Other options

initialValue

Initial value of amount-control, for example, 1.

maximum

Limits the maximum number to be selected.

minimum

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

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, and disable the ability to increase or decrease the amount.

State configuration
Key
Notes

=@ctx.component.state.

value

Component state variable that can be used throughout the jig.

=@ctx.jig.state.

filter searchText

Jig-level state that applies to the specific jig (screen) context, with available keys depending on the jig type (e.g., for list jigs: filter, searchText, etc.)

Considerations

  • Amount-control can be used as a standalone component or combined with other components, such as in a form, section, or card.

  • OnDelete is not configured by default, you must configured to include the delete (trash) icon.

  • If no initialValue is specified an Add button displays, once tapped the amount control increase and decrease options display.

Examples and code snippets

Basic standalone amount-control

Basic amount-control in a card
Basic amount-control in a card

This example shows a basic amount-control inside a card layout. The card contains a centered image and an amount-control component that lets the user adjust a quantity using plus and minus buttons. The control is configured with an initialValue of 1, a minimum of 0, a maximum of 5, and a step of 1 for each increment or decrement. This setup is ideal for simple quantity selection, such as choosing how many items to add to a cart.

Examples:

See the full example in GitHub.

Amount-control with onChange and OnDelete

In this example the amount-control is configured with an onChange and OnDelete event to record the order in the product-orders database. Each event triggers an execute-entity action with the corresponding method.

Examples:

See the full example in GitHub.

  • Tapping the plus or minus button is considered an onChange event.

  • The onDelete event is shown with the trash can icon.

Amount-control with onChange & onDelete
Amount-control with onChange & onDelete

Standalone amount-control

Standalone amount-control
Standalone amount-control

This example shows a standalone amount-control component used to adjust product quantities in an e-commerce interface. It allows you to increase or decrease the selected amount using simple plus and minus controls, making it ideal for shopping cart or product detail screens.

Examples:

See the full example in GitHub.

Last updated

Was this helpful?