Component basics
Last updated
Was this helpful?
Last updated
Was this helpful?
You can access all available components in the Components tab of the left side panel. To add any component to your app page, simply drag it from the sidebar and drop into your working area. You can also change the component's size by dragging the resize handlers.
When you select a component, you can configure its properties via the right side panel. Here, you can change component structure, adjust settings and styles. You can also remove the component altogether by clicking on the Bin icon.
Here, in component properties, you can also see where a specific component is used - whether itβs in other components or actions. The icon will show you if there're any usages at all - you don't have to click it. Usages are grouped by target, with the following path format: name β property
.
If you click on a specific property or path in the Usages, you will be taken to the corresponding component or action, and you'll be able to make any adjustments if needed.
To connect your data to such components as Table, Chart, List View, and Grid View, you simply need to select the necessary action or variable in the component's Data field dropdown. The dropdown shows all available actions and variables - Suggested, Page, and App - and you can easily switch between them. The component structure is automatically regenerated based on your selection. If you need to undo the changes, you can revert component structure to its previous state by clicking Undo in the toast that appears at the top or clicking the Revert button next to component structure.
The JS mode is still available for these components so you can switch to it if you prefer. In this mode, you can bind your actions to components manually, like before, and also manually regenerate component structure.
To connect your data to all other components, you need to manually reference the necessary action or component property in the component's Data field. Similarly, you can also change component data by removing the previously connected data and selecting new one. Once selected, you can auto-sync the new action's structure by clicking the Generate structure button. Thus, you won't have to build new component structure from scratch.
Component name is generated automatically when you assign an action to it. Name generation is based on the following rules:
If an action has a resource, for example a Table, then the component name is based on the Table name. For example, Load Users action -> usersTable.
If there is no resource, then the component name is based on the action name. For example, JavaScript Code step called loadUsersData -> usersDataTable.
Such components as Input, Date picker, File picker, and complex components like Form and Table can produce values. When you enter something into an input, select a row in a table or submit a form, you can use component values as variables.
Such variables are available under {{ui.componentName.*}}
.
You can simply type {{ui.
in any code or text field in the component or action settings to see a list of all available variables.
Simple components, such as Input and Date picker, have a value property. It's a reference to the current component value:
In a Form component, the value key will be a reference to the whole Form object. The keys represent the Form input names and values:
A Table component has multiple keys, such as selectedRow
, editedRow
, newRow
and deletedRow
with the following inners properties:
These are only a few examples of component properties - more are available.
UI Bakery allows hiding components by configuring their Show condition as false
.
By default, hidden components do not occupy space in the working area. However, if you enable the option to Preserve space when hidden, the component's layout will remain intact regardless of its visibility. This ensures that components maintain their fixed positioning irrespective of whether they are visible or hidden.
The Show condition value is determined based on truth evaluation. For example, you can use the state of one component to control the visibility of another component.
Let's say you have a Table component added to your working area and you want to control its visibility with the help of a Checkbox:
Add a Checkbox component to your canvas.
Next, select the Table and set its Show condition as {{ui.checkbox.value}}
.
This will evaluate as true
when the checkbox is selected, and false
when it is cleared.
Test it out - select and clear the checkbox to either show/hide your Table component.
Learn more about controlling component visibility