# Component basics

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.

{% embed url="https://demo.arcade.software/RyVaTzCFWSkoNHGv1Vqp?embed=&embed_desktop=inline&embed_mobile=tab&show_copy_link=true" %}

## Component triggers

Each component has its own triggers that can launch specific events - actions that you assign to them. \
You can find the **Triggers** section in the right side panel along with other component properties. There, you need to select the trigger you need from the dropdown and assign an action to it.

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2Fh1vVXm2HOJPOesZzFGop%2FCleanShot%202025-05-27%20at%2016.08.05%402x-min.png?alt=media&#x26;token=fa4d9990-1a0a-4821-aa2d-95031fd234d9" alt=""><figcaption></figcaption></figure>

One of the basic examples here could be two dependent _Select_ components where the values available in the second dropdown depend on the value selected in the first one.

In our example below, we have two dropdowns (_Make_ and _Model_), and based on the car make selected in the first dropdown, available car models are displayed in the second one.\
To achieve this, we created a _JavaScript Code_ step and assigned it to the parent Select's (_Make dropdown_) **On Change** trigger:

```javascript
if (data === 'Toyota') {
  return ['Highlander', 'Prius', 'Celica']
}
if (data === 'Ford') {
  return ['Falcon', 'Fusion']
}
if (data === 'Mercedes-Benz') {
  return ['SLS-Class', 'CLS-Class', 'CL-Class']
}
```

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2F6Tnh9pETfAhnjFFi3qgx%2FCleanShot%202025-06-03%20at%2014.54.26%402x-min.png?alt=media&#x26;token=f7f165df-610d-4c4f-ae9d-b17776bfe3e7" alt=""><figcaption></figcaption></figure>

Once you select the car make in the first dropdown, it will filter only its specific models in the second dropdown.

## Component usages

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`.&#x20;

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.

{% embed url="https://demo.arcade.software/uWHmhh2EZm6IeIRTcDkt?embed=&embed_desktop=inline&embed_mobile=tab&show_copy_link=true" %}

## Connecting to data

To connect your data to such components as [**Table**](../../reference/working-with-components/table), [**Chart**](../../reference/working-with-components/chart), [**List View**](../../reference/working-with-components/list-view), and [**Grid View**](../../reference/working-with-components/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.

{% hint style="info" %}
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.
{% endhint %}

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_](../../../getting-started/bind-data-to-ui#the-generate-structure-button-works-in-the-following-way) button. Thus, you won't have to build new component structure from scratch.

{% embed url="https://demo.arcade.software/EXKLNAWOUMyQvIx6dKpM?embed=&embed_desktop=inline&embed_mobile=tab&show_copy_link=true" %}

### Component name generation on action assignment

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_.

## Accessing component variables

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.

{% embed url="https://demo.arcade.software/ll22EL6ALOgPedZ0gzVl?embed=&embed_desktop=inline&embed_mobile=tab&show_copy_link=true" %}

* Simple components, such as **Input** and **Date picker**, have a value property. It's a reference to the current component value:

```
{{ui.input.value}} // current input 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:

```
{{ui.form.value}} // { name: 'John', age: 30 }
```

* A **Table** component has multiple keys, such as `selectedRow`, `editedRow`, `newRow` and `deletedRow` with the following inners properties:

```
{{ui.table.selectedRow.isSelected}} // true/false
{{ui.table.selectedRow.data}} // selected row {} or null
{{ui.table.editedRow.data}} // edited {} BEFORE the edit
{{ui.table.editedRow.newData}} // edited {} AFTER the edit
{{ui.table.newRow.newData}} // newly created row {}
{{ui.table.deletedRow.data}} // deleted row {}
```

{% hint style="info" %}
These are only a few examples of component properties - more are available.
{% endhint %}

## Show/hide components

UI Bakery allows hiding components by configuring their **Show condition** as `false`.

{% hint style="info" %}
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.
{% endhint %}

<figure><img src="https://837703843-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUX6zPRMFFK0yrTghj7cY%2Fuploads%2FsTeaI3NFPTfruc9qsogW%2FCleanShot%202024-12-02%20at%2014.21.25%402x-min.png?alt=media&#x26;token=6a0d34a6-f910-45d4-a4d8-c1b6030f5a29" alt=""><figcaption></figcaption></figure>

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:

1. Add a **Checkbox** component to your canvas.
2. Next, select the Table and set its **Show condition** as `{{ui.checkbox.value}}`.

{% hint style="info" %}
This will evaluate as `true` when the checkbox is selected, and `false` when it is cleared.
{% endhint %}

3. Test it out - select and clear the checkbox to either show/hide your Table component.

{% embed url="https://demo.arcade.software/SfMI4ay72hxWKpCCJN2X?embed=&embed_desktop=inline&embed_mobile=tab&show_copy_link=true" %}

Learn more about controlling component visibility:point\_down:

{% content-ref url="work-with-components/control-components-visibility" %}
[control-components-visibility](work-with-components/control-components-visibility)
{% endcontent-ref %}
