# ScrollbarComponentElement

Class · extends [`ComponentElement`](https://api.playcanvas.com/web-components/classes/ComponentElement.md)`<ScrollbarComponent>` · category: Components

Source: https://github.com/playcanvas/web-components/blob/252f001881302c266c8d727044408c32be2bb5e7/src/components/scrollbar-component.ts#L28

The ScrollbarComponentElement interface provides properties and methods for manipulating
[`<pc-scrollbar>`](https://developer.playcanvas.com/user-manual/web-components/tags/pc-scrollbar/) elements.
The ScrollbarComponentElement interface also inherits the properties and methods of the
[HTMLElement](https://developer.mozilla.org/docs/Web/API/HTMLElement) interface.

Engine component: [ScrollbarComponent](https://api.playcanvas.com/engine/classes/ScrollbarComponent.html) (`scrollbar`).

**elementSummary** The `<pc-scrollbar>` element gives its entity a draggable handle reporting a
position from 0 to 1, which a `<pc-scroll-view>` references to scroll its content. Must be a
child of a `<pc-entity>`, `<pc-model>` or `<pc-node>`.

## Accessors

### component

```ts
get component(): ScrollbarComponent | null
```

Gets the underlying PlayCanvas scrollbar component. `null` until the element is
ready — see [ComponentElement.component](https://api.playcanvas.com/web-components/classes/ComponentElement.md#component).

### handle

```ts
get handle(): string
set handle(value: string)
```

Gets the reference (a `pc-entity`, `pc-model` or `pc-node` name, or a document-wide `#`
selector) to the entity used as the scrollbar handle.

### handleSize

```ts
get handleSize(): number
set handleSize(value: number)
```

Gets the size of the handle relative to the size of the track.

### orientation

```ts
get orientation(): "horizontal" | "vertical"
set orientation(value: "horizontal" | "vertical")
```

Gets the orientation of the scrollbar.

### value

```ts
get value(): number
set value(value: number)
```

Gets the current position value of the scrollbar.

## Methods

### getInitialComponentData

```ts
protected getInitialComponentData(): Record<string, any>
```

Returns the data the component is created with. Overridden by subclasses to supply the
initial values of their cached properties. The element's `enabled` state is not among them:
the base class adds it when it creates the component.

**Returns** `Record<string, any>`: The initial component data.

## Inherited from [ComponentElement](https://api.playcanvas.com/web-components/classes/ComponentElement.md)

- `get closestApp(): AppElement | null`
- `get closestEntity(): EntityBaseElement | null`
- `get enabled(): boolean` · `set enabled(value: boolean)`
- `protected _onReady(): void`
- `protected _resetReady(): void`
- `protected initComponent(): void`
- `ready(): Promise<ScrollbarComponentElement>`
