Component basics
Last updated
Last updated
© 2024 UI Bakery
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.
If you have an action that is currently selected in the Actions panel, UI Bakery will try to automatically connect a newly added component to this action. It will also generate component structure from the action's response and its type.
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 a component, you simply need to reference the necessary action or component property in the component 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. Thus, you won't have to build new component structure from scratch.
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👇
Control component's visibility