Custom components (Alpha)
Custom components (Alpha)
Custom components (Alpha)
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.
Jigx 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.
Custom components extend the standard set of components in Jigx to provide additional UI capabilities and features. To understand what custom components are, when and why you would use them, see Custom Components (Alpha).
Creating custom components (Alpha) explains where and how to create the components and how to reuse them in a jig.
Passing data in and out of custom components is explained in Inputs & outputs (Alpha).
Combine custom & standard components (Alpha) to create your own customized components and templates.
Jigx offers a variety of Templates (Alpha) ready to use in your app, making development faster and easier. Select the template you want to use, copy the code from GitHub, and customize it to meet your needs.
The components that fall into the custom component category are:
How to create a custom component
In Jigx Builder in the components folder, create a new jigx file, e.g., custom-button.jigx.
Select the
type: component.default. All custom components require this type.Under the
children:property, use IntelliSence (Ctrl+space) to see the list of available components. Select the components, e.g.,type: component.button.Under the
options:properties, create a space and use ctrl+space to open the IntelliSense popup**.**You can select the styling properties from the list shown.
Configure the other properties provided in the code snippet.
Open the jig where you want to use the custom component and reference
component.custom-component. Use thecomponentIdproperty to reference the name of the custom component file, e.g.,componentId: custom-button.Test the jig on a mobile device to ensure the button is rendering correctly.
Considerations
Localization can be applied to custom components such as Button (Alpha) and Text (Alpha).
You can nest custom components by using
component.custom-componentand referencing the desired component in thecomponentIdproperty.type: component.default componentId: brand-form children: # Reference a custom component inside this custom component using componentId. - type: component.custom-component componentId: itinerary-day - type: component.card options: children: - type: component.form instanceId: new-form options: children: - type: component.text-field instanceId: company-name options: label: Company NameWhen using
component.imagein a custom component, theheightproperty must be specified as part of thesizeproperty, otherwise validation errors occur, see below:
# Correct YAML snippet for using the height property in the image component,
# when used in a custom component.
- type: component.image
options:
size:
height: 196
source:
uri: https://images# Incorrect YAML snippet for using the height property in the image component,
# when used in a custom component.
- type: component.image
options:
height: 196
source:
uri: https://imagesLast updated
Was this helpful?