Components

Common component properties

2min

Some properties are common to all components. See the details below:

When

when - this property is used at two levels, in components to show/hide any component conditionally and in actions to execute/not execute an action.

Below are the settings to use with the when property:

  • when: true
  • when: false
  • when: =@ctx set with an expression

Example and code snippet

The example below demonstrates how the when property is used at a component level to display a component.text-field (Note requirements) only when the component.checkbox (Special Diet) is selected.

When-Display a field
When-Display a field

When.jigx
datasource


Applying colors based on specific conditions

Colors can be configured based on specific conditions. For example, a payment amount exceeding a certain threshold can be displayed in red. However, conditional color configurations are only available in areas that support conditions, such as list items. In contrast, direct color options are more widely supported, for example, lists allow both conditional and direct setups, whereas interactive-images only support direct options. Additionally, certain areas restrict the available color choices, while UI elements support the predefined set of fourteen colors.

  • When configuring the color property, select the color condition option.
  • Under the when property, add an expression that defines the condition under which the specified color should be applied.
color-condition
color (no condition)





Updated 10 Mar 2025
Doc contributor
Did this page help you?