View (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.
The component.view is an empty container similar to the <div> element in CSS or HTML. Use the view component for layouts. The YAML always has the style: property under which all style elements such as color and direction for rows and columns are located, and the children: property for adding other components such as avatar, text, and icons. Multiple layers of the view component can be used to create UI requirements. You can also place a component.card inside the view and vice versa. If you are unfamiliar with CSS or HTML, there are several resources available, such as https://www.w3schools.com/, that can assist you when configuring a view component.
For steps on creating a custom component, see How to create a custom component.
Configuration options
You can use when and instanceId with component.view, add the properties before the options: property. The available list of style options is shown below.
alignContent
Determine how content in the view will be aligned, applies to any component contained in the view. The following options are available: center flex-end flex-start space-around space-between stretch
alignItems
Available options include: baseline center flex-end flex-start stretch
alignSelf
Available options include: auto baseline center flex-end flex-start stretch
background
color - multiple, use IntelliSense to view the available list. See to view the different colors. emphasis - change the brightness and boldness of the content in the view. Available options include: - high - medium - low - extra-low - low-medium
border
Configure the border using these properties: bottom color - multiple, use IntelliSense to view the available list. emphasis - color, high, medium, low, extra-low, low-medium end left right start - style style - solid, transparent, true top width - use a number or expression.
bottom
Configure the spacing at the bottom of the view using these properties: large medium small regular minimal none
emphasis
Change the brightness and boldness of the content in the view. Available options include: high medium low extra-low low-medium
flex
Available options include: basis- use a number or expression. direction - column, column-reverse, row, row-reverse grow - use a number or expression shrink - use a number or expression wrap - wrap, nowrap, wrap-reverse For more information on using the flex property, see
gap
Configure the gap in the view. Available options include: column - large, medium, small, regular, minimal, none large medium none minimal regular row - large, medium, small, regular, minimal, none small
hasShadow
A boolean property used to toggle the display of a shadow beneath the component. When set to true, the control renders with a subtle shadow effect, helping it stand out visually against the background. This enhances the visual hierarchy and depth in the mobile app interface. When set to false (or omitted), no shadow is applied.
height
Determine the height of the view. Available options include: max min value
justifyContent
Available options include: center flex-end flex-start space-around space-between space-evenly
left
Available options include: large medium small regular minimal none
margin
Configure different margins in the view, available options include: bottom - large, medium, small, regular, minimal, none end - large, medium, small, regular, minimal, none horizontal - large, medium, small, regular, minimal, none large left - large, medium, small, regular, minimal, none medium minimal none regular right - large, medium, small, regular, minimal, none small start - large, medium, small, regular, minimal, none top - large, medium, small, regular, minimal, none vertical - large, medium, small, regular, minimal, none
overflow
Available options include: hidden scroll visible
padding
Configure different paddings in the view, available options include: bottom - large, medium, small, regular, minimal, none end - large, medium, small, regular, minimal, none horizontal - large, medium, small, regular, minimal, none large left - large, medium, small, regular, minimal, none medium minimal none regular right - large, medium, small, regular, minimal, none small start - large, medium, small, regular, minimal, none top - large, medium, small, regular, minimal, none vertical - large, medium, small, regular, minimal, none
position
Available options include: absolute relative
radius
Available options include: large medium regular small tiny bottomLeft - large, medium, regular, small, tiny bottomrRight - large, medium, regular, small, tiny topRight - large, medium, regular, small, tiny topLeft - large, medium, regular, small, tiny
right
Available options include: large medium small regular minimal none
top
Available options include: large medium small regular minimal none
width
Available options include: max min value
Considerations
When using the
component.imageon custom components, theisFlexibleproperty is available. If the property is set totrue, the image will take the parent's space. If the parent has zero height or zero width, the image will not render. Set theheightandwidthon the image, or setisFlexibletotrue.When using the
component.imagein thecomponent.viewto define theheight, e.g., 100, and settingisFlexible: truefor each image. This allows the images to grow into the parent component space.In styles, you cannot use
flexGrowandwidthtogether. Use one or the other; if combined, the width property does not function, and the UI element will not render as designed.By default,
childrencomponents are stacked in a column.To ensure that
textandiconsdo not run over borders in the app, useflex:grow:1andshrink:1together.
Example and code samples
Itinerary using views to create columns and rows
This example shows using the component.view to create the layout for an itinerary. The view component creates a wrapper for the content, rows to show content in, and columns to create spacing between the content. The component.text is used inside the view component to show the content and the component.image shows the required images.
Examples:
Other view layout examples
Explore a variety of additional code examples demonstrating the use of the view component on GitHub. These examples showcase different configurations and use cases to help you achieve different layouts.
Last updated
Was this helpful?