Building Apps with Jigx
...
UI
Custom Components (Alpha)

Inputs & outputs (Alpha)

7min

This feature is currently in its Alpha stage of development.

  • As an early version, it may not include all planned functionalities and is subject to significant changes based on ongoing development and user feedback.
  • In this phase, the feature may contain bugs or behave unpredictably.
  •  recommends using standard, fully supported components until this feature has been fully tested and refined.
  • We encourage you to provide feedback and report any issues to help us improve and refine the feature for future releases.


Use inputs and outputs to transfer and read data in custom components. This approach lets you configure a component once and reuse it across multiple screens or even on the same screen. By simply defining different inputs and outputs each time the component is used, you can display varied data and adapt to different contexts effortlessly.

Inputs

Define inputs in the custom component, then in the using the custom component, provide the data/context for the input, either referencing a datasource or adding values.

Examples and code snippets

In this example, we create a tab component using the view and text custom components. By leveraging inputs, the tab component can be reused within the same . The first tab component is center-aligned with four tabs, while the second is left-aligned with three tabs. Tab names for each component are dynamically set using the tabName input.

Tabs using inputs
Tabs using inputs


For more examples using inputs, see the following:







Ratings

Tags

Sections

Toggles

Countdown

Stepper



custom-component.jigx
jig.jigx


Outputs

  • The output and input work in conjunction with each other.
  • Define outputs in the custom component, then in the using the custom component, provide the data/context (input) by referencing the custom-component instanceId.
  • An instanceId is required for the custom component that is exposing an output in order to access the output via state.
  • The output requires an output-key and a data value that is available in the custom component.
  • Accessing outputs uses the format similar to: =@ctx.components.[instanceId].outputs.output-key. Use to assist with configuration.

Examples and code snippets

In this simple example, the custom component is configured with a form in a card component. An output property is added to the custom component. This allows for the data entered into the custom component's form on the to be transferred to the title property of the image component on the .



Output data to image label
Output data to image label

custom-component
jig.jigx


See also