> For the complete documentation index, see [llms.txt](https://smartui-docs.pixelperfectstudio.mx/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://smartui-docs.pixelperfectstudio.mx/framework-addons/scroll-bar.md).

# Scroll Bar

SmartUI Scroll-Bar Behavior operation and ACEs.

<img src="https://3242409510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9bZkqK9vYvPkvVDUO4Tp%2Fuploads%2F5jRMoCs9pb7CSoxM6GwY%2Ficon.svg?alt=media&amp;token=19d7553c-e992-451f-ac27-daff0a455e6f" alt="" data-size="line"> Scrollbars are a convenient component for managing user input of values within a fixed range. These values can be either negative or positive; the component is flexible enough to handle the value range where it operates. Scrollbars can also function as sliders, depending on the components you add when composing it.&#x20;

This is a composite and complex object, as it combines several SmartUI components to provide its functionality. It directly inherits its main features from a [Container](/framework-addons/container-behavior.md).

A scroll-bar is composed of four parts:

1. The <img src="https://3242409510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9bZkqK9vYvPkvVDUO4Tp%2Fuploads%2F5jRMoCs9pb7CSoxM6GwY%2Ficon.svg?alt=media&amp;token=19d7553c-e992-451f-ac27-daff0a455e6f" alt="" data-size="line"><mark style="color:green;">**scroll-bar**</mark> itself, which acts as a container for the other objects and provides the ACEs to operate it.
2. A <img src="https://3242409510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9bZkqK9vYvPkvVDUO4Tp%2Fuploads%2FxKAFoQLyUNo848uv4SeN%2Ficon.svg?alt=media&amp;token=a5bf7e43-6e48-4f2d-b82f-2813ba41135a" alt="" data-size="line"><mark style="color:green;">**slider**</mark>, an object using the [Button Behavior](/framework-addons/button-behavior.md) that must be a child of the scrollbar.
3. Two <img src="https://3242409510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9bZkqK9vYvPkvVDUO4Tp%2Fuploads%2FxKAFoQLyUNo848uv4SeN%2Ficon.svg?alt=media&amp;token=a5bf7e43-6e48-4f2d-b82f-2813ba41135a" alt="" data-size="line"><mark style="color:green;">**scroll buttons**</mark>, also using the  [Button Behavior](/framework-addons/button-behavior.md), which increase or decrease the value of the bar by the assigned step size.

<figure><img src="https://3242409510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9bZkqK9vYvPkvVDUO4Tp%2Fuploads%2Fk3WYUDV9bAvYdR73Dfm1%2Fimage.png?alt=media&amp;token=ef63de88-ea5c-4172-b29b-063f58ec277c" alt="" width="305"><figcaption><p>Structure of a scroll-bar component</p></figcaption></figure>

{% hint style="warning" %} <mark style="color:orange;">**The scrollbar's origin must always be on the left side.**</mark> The slider's position is adjusted from the origin, considering the scrollbar's angle, so you can rotate the bar at any angle to fit your design.
{% endhint %}

In the image above, we have a bar at the center that uses the Scrollbar behavior, a slider button (red square) that uses the Button behavior, and two scroll buttons to increase or decrease the value within the range, also using the Button behavior. All of these must be children of the scrollbar container.

{% hint style="info" %}
The scroll buttons can be placed anywhere in the layout to fit your needs, as long as they are children of the scrollbar component.
{% endhint %}

To compose the scrollbar in the properties, use the component's name property. Under the scrollbar object hierarchy, there must be only one component that matches the name assigned to its functions.

<figure><img src="https://3242409510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9bZkqK9vYvPkvVDUO4Tp%2Fuploads%2FKrh0YJuTd5BXTMrqrMDC%2Fimage.png?alt=media&amp;token=e58a937e-8199-435e-93aa-376e34b131d1" alt="" width="292"><figcaption><p>The names of the child components must exactly match the ones assigned to compose the scrollbar.</p></figcaption></figure>

{% hint style="info" %}
Scroll buttons will always change the value by the number set in the *<mark style="color:blue;">**Step Size**</mark>* field, regardless of whether the bar operates with floating values or integer values.
{% endhint %}

{% hint style="warning" %}
Please be aware that all the children of the <mark style="color:orange;">**component must have change propagation enabled for all attributes**</mark>: visible, opacity, x, y, width, height, etc. Otherwise, you will need to manually control the children's attributes.
{% endhint %}

<div align="center"><figure><img src="https://3242409510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9bZkqK9vYvPkvVDUO4Tp%2Fuploads%2FLG7wPMMADuggH5RmlCNk%2Fimage.png?alt=media&amp;token=c6cf5652-a4b4-47ba-87d9-9682331183d9" alt="" width="235"><figcaption><p>Properties transformation should be enabled to render children correctly.</p></figcaption></figure></div>

<details>

<summary>Download</summary>

<https://store.pixelperfectstudio.mx/product/smart-ui-ncbeta/>

</details>

## :tv:Basic Setup - Tutorial Video

{% embed url="<https://youtu.be/hSrO_K3o-FU>" %}

## Properties

<table data-header-hidden><thead><tr><th width="249"></th><th></th></tr></thead><tbody><tr><td><strong>Property</strong></td><td><strong>Description</strong></td></tr><tr><td><code>Enabled</code></td><td>Enables or Disables the Scroll Bar. Value can still be set and it will change the Scroll Bar, but animations won't be triggered. You can use the IsEnabled condition to affect the look and feel when needed.</td></tr><tr><td><code>Focusable</code></td><td>Marks if the component can have the focus.</td></tr><tr><td><code>Index</code></td><td>Index of the element within a container. Used for focusing the elements in the sequence order.</td></tr><tr><td><code>Invisible Component</code></td><td>Turns the component opacity to 0 while rendering it to allow invisible interactions.</td></tr><tr><td><code>Automatic-Color</code></td><td>Enables the component to darken a bit when its state is Disabled or when it's focused. Auto-Color is meant to provide a quick identification of the component state. For more specialized customizations, use the component events and disable this check.</td></tr><tr><td><code>Name</code></td><td>Unique name string for identifying the Scroll Bar</td></tr><tr><td><code>Step Size</code></td><td>Fixed value increment for stepping-mode sliders.</td></tr><tr><td><code>Value</code></td><td>Numeric value representing the current progress.</td></tr><tr><td><code>Min.Value</code></td><td>Minimum value.</td></tr><tr><td><code>Max.Value</code></td><td>Maximum value</td></tr><tr><td><code>Result Mode</code></td><td>Discrete mode handles floating values with discrete selection. Step mode handles integer values with precise location for the slider button.</td></tr><tr><td><code>Inc.Button</code></td><td>Increment button name</td></tr><tr><td><code>Dec.Button</code></td><td>Decrement button name</td></tr><tr><td><code>Slider Button</code></td><td>Slider button name</td></tr></tbody></table>

## <img src="https://3242409510-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9bZkqK9vYvPkvVDUO4Tp%2Fuploads%2F5jRMoCs9pb7CSoxM6GwY%2Ficon.svg?alt=media&amp;token=19d7553c-e992-451f-ac27-daff0a455e6f" alt="" data-size="line"> Smart UI Scroll Bar

Smart UI Scroll Bar behavior handles Scroll Bar UI components. Handles value ranges within a limit.&#x20;

## Actions

***

### `Set Enabled`

Disable/Enable the scroll bar

| **Parameter** | **Description**  |
| ------------- | ---------------- |
| `Enabled`     | Enabled/Disabled |

### `Set Focus`

Sets the focus on the component, removing the focus from all the components within the same container.

### `Set Focusable`

Sets the component to be able to receive the focus

| **Parameter** | **Description**                            |
| ------------- | ------------------------------------------ |
| `Focusable`   | Flag to allow the component to be focused. |

### `Set Max`

Sets the maximum value of the Scroll Bar.

| **Parameter** | **Description** |
| ------------- | --------------- |
| `Value`       | Maximum value.  |

### `Set Min`

Sets the minimum value of the Scroll Bar.

| **Parameter** | **Description** |
| ------------- | --------------- |
| `Value`       | Minimum value.  |

### `Set Name`

Sets the name of the component.

| **Parameter** | **Description**       |
| ------------- | --------------------- |
| `Name`        | Name of the component |

### `Set Value`

Sets the current value of the Scroll Bar. If the value is below 0 or above the maximum, it will be clamped.

| **Parameter** | **Description**                                 |
| ------------- | ----------------------------------------------- |
| `Value`       | Numeric value representing the current progress |

## Conditions

***

### `Compare Value`

Compares the value of the Scroll Bar.

| **Parameter** | **Description**               |
| ------------- | ----------------------------- |
| `Comparison`  | How to compare the variable   |
| `Value`       | Value to compare the variable |

### `Compare Name`

Returns true if the Scroll Bar components name equals the parameter

| **Parameter** | **Description**                            |
| ------------- | ------------------------------------------ |
| `Name`        | Name to compare with the component picked. |

### `Is Dragging`

True when the slider scroll bar is being dragged to set a value. Use DragValue expression to retrieve the value.

### `Is Enabled`

Returns true if the Scroll Bar is enabled

### `undefined`

undefined

### `Is Focused`

Returns true if the scroll bar has the focus

### `On Focus`

Triggered when the scroll bar gets the focus

### `On Focus Lost`

Triggered when the scroll bar loses focus

### `On Value Change`

Triggered when the Scroll Bar value changes. When dragging the slider, value will be set only when it's released.

## Expressions

***

### `AnimatedProgress`

Percentage representing the AnimatedValue from the Max value allowed to be set for the Scroll Bar. This value is set only when the animation is running

### `AnimatedValue`

Current animated value. This value is set only when the animation is running. E.G. If you are changing the value from 0 to 10, it will contain all the step values to reach the 10, as if it was counting.

### `Name`

Component name

### `DragValue`

Scroll Bar value while being dragged. Value becomes final after the user releases the slider. Always use Value expression to retrieve the correct value.

### `Max`

Scroll Bar Maximum value.

### `Min`

Scroll Bar Minimum value.

### `Progress`

Scroll Bar progress value in percentage.

### `Value`

Scroll Bar current value.

**(c) Pixel Perfect Studio 2024**
