# ScrollBar

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls/primitives/struct-scrollbar/

**struct** · [`ferroui-controls`](/docs/0.5.0/api/ferroui-controls/) · v0.5.0

```rust
struct ScrollBar
```

A scrollbar control.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L63)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`TEMPLATE_PARTS`](#assoc_const-template_parts)
- [`PSEUDO_CLASSES`](#assoc_const-pseudo_classes)
- [`viewport_size_property`](#function-viewport_size_property)
- [`visibility_property`](#function-visibility_property)
- [`orientation_property`](#function-orientation_property)
- [`is_expanded_property`](#function-is_expanded_property)
- [`allow_auto_hide_property`](#function-allow_auto_hide_property)
- [`hide_delay_property`](#function-hide_delay_property)
- [`show_delay_property`](#function-show_delay_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`viewport_size`](#function-viewport_size)
- [`set_viewport_size`](#function-set_viewport_size)
- [`visibility`](#function-visibility)
- [`set_visibility`](#function-set_visibility)
- [`orientation`](#function-orientation)
- [`set_orientation`](#function-set_orientation)
- [`is_expanded`](#function-is_expanded)
- [`allow_auto_hide`](#function-allow_auto_hide)
- [`set_allow_auto_hide`](#function-set_allow_auto_hide)
- [`hide_delay`](#function-hide_delay)
- [`set_hide_delay`](#function-set_hide_delay)
- [`show_delay`](#function-show_delay)
- [`set_show_delay`](#function-set_show_delay)
- [`scroll`](#function-scroll)
- [`on_scroll`](#function-on_scroll)
- [`scroll_here`](#function-scroll_here)
- [`scroll_to_home`](#function-scroll_to_home)
- [`scroll_to_end`](#function-scroll_to_end)
- [`page_up`](#function-page_up)
- [`page_down`](#function-page_down)
- [`page_left`](#function-page_left)
- [`page_right`](#function-page_right)
- [`line_up`](#function-line_up)
- [`line_down`](#function-line_down)
- [`line_left`](#function-line_left)
- [`line_right`](#function-line_right)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L79)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<ScrollBar>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L79)

<a id="assoc_const-template_parts"></a>

### TEMPLATE_PARTS

```rust
const TEMPLATE_PARTS: &'static [TemplatePartAttribute]
```

The named parts expected in the control template.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L294)

<a id="assoc_const-pseudo_classes"></a>

### PSEUDO_CLASSES

```rust
const PSEUDO_CLASSES: PseudoClassesAttribute
```

The pseudoclasses set by the class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L302)

<a id="function-viewport_size_property"></a>

### viewport_size_property

```rust
fn viewport_size_property() -> &'static StyledProperty<f64>
```

Defines the `ViewportSize` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L305)

<a id="function-visibility_property"></a>

### visibility_property

```rust
fn visibility_property() -> &'static StyledProperty<ScrollBarVisibility>
```

Defines the `Visibility` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L305)

<a id="function-orientation_property"></a>

### orientation_property

```rust
fn orientation_property() -> &'static StyledProperty<Orientation>
```

Defines the `Orientation` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L305)

<a id="function-is_expanded_property"></a>

### is_expanded_property

```rust
fn is_expanded_property() -> &'static DirectProperty<ScrollBar, bool>
```

Defines the `IsExpanded` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L305)

<a id="function-allow_auto_hide_property"></a>

### allow_auto_hide_property

```rust
fn allow_auto_hide_property() -> &'static StyledProperty<bool>
```

Defines the `AllowAutoHide` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L305)

<a id="function-hide_delay_property"></a>

### hide_delay_property

```rust
fn hide_delay_property() -> &'static StyledProperty<Duration>
```

Defines the `HideDelay` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L305)

<a id="function-show_delay_property"></a>

### show_delay_property

```rust
fn show_delay_property() -> &'static StyledProperty<Duration>
```

Defines the `ShowDelay` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L305)

<a id="function-construct"></a>

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L378)

<a id="function-new"></a>

### new

```rust
fn new() -> Ref<Self>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L396)

<a id="function-viewport_size"></a>

### viewport_size

```rust
fn viewport_size(self: &Self) -> f64
```

The amount of the scrollable content that is currently visible.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L401)

<a id="function-set_viewport_size"></a>

### set_viewport_size

```rust
fn set_viewport_size(self: &Self, value: f64)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L405)

<a id="function-visibility"></a>

### visibility

```rust
fn visibility(self: &Self) -> ScrollBarVisibility
```

Indicates whether the scrollbar should hide itself when it is not
needed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L411)

<a id="function-set_visibility"></a>

### set_visibility

```rust
fn set_visibility(self: &Self, value: ScrollBarVisibility)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L415)

<a id="function-orientation"></a>

### orientation

```rust
fn orientation(self: &Self) -> Orientation
```

The orientation of the scrollbar.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L420)

<a id="function-set_orientation"></a>

### set_orientation

```rust
fn set_orientation(self: &Self, value: Orientation)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L424)

<a id="function-is_expanded"></a>

### is_expanded

```rust
fn is_expanded(self: &Self) -> bool
```

Indicates whether the scrollbar is expanded.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L429)

<a id="function-allow_auto_hide"></a>

### allow_auto_hide

```rust
fn allow_auto_hide(self: &Self) -> bool
```

Indicates whether the scrollbar can hide itself when the user is not
interacting with it.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L439)

<a id="function-set_allow_auto_hide"></a>

### set_allow_auto_hide

```rust
fn set_allow_auto_hide(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L443)

<a id="function-hide_delay"></a>

### hide_delay

```rust
fn hide_delay(self: &Self) -> Duration
```

Determines how long the hide delay will be after the user stops
interacting with the scrollbar.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L449)

<a id="function-set_hide_delay"></a>

### set_hide_delay

```rust
fn set_hide_delay(self: &Self, value: Duration)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L453)

<a id="function-show_delay"></a>

### show_delay

```rust
fn show_delay(self: &Self) -> Duration
```

Determines how long the show delay will be when the user starts
interacting with the scrollbar.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L459)

<a id="function-set_show_delay"></a>

### set_show_delay

```rust
fn set_show_delay(self: &Self, value: Duration)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L463)

<a id="function-scroll"></a>

### scroll

```rust
fn scroll(self: &Self, handler: impl Fn(&ScrollEventArgs) -> () + 'static) -> Subscription
```

Raised when the scrollbar scrolls. The handler receives the event
data, as the handlers of the other plain events do.

Dropping the returned guard removes the handler;
`Subscription::detach` keeps it for the life of the scroll bar.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L472)

<a id="function-on_scroll"></a>

### on_scroll

```rust
fn on_scroll(self: &Self, scroll_event_type: ScrollEventType)
```

Raises the scroll event.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L719)

<a id="function-scroll_here"></a>

### scroll_here

```rust
fn scroll_here(self: &Self)
```

Scrolls to the location at which the context menu was most recently
requested.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L748)

<a id="function-scroll_to_home"></a>

### scroll_to_home

```rust
fn scroll_to_home(self: &Self)
```

Scrolls to the top (or left edge) of the scrollbar by setting the
value to the minimum.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L776)

<a id="function-scroll_to_end"></a>

### scroll_to_end

```rust
fn scroll_to_end(self: &Self)
```

Scrolls to the bottom (or right edge) of the scrollbar by setting the
value to the maximum.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L783)

<a id="function-page_up"></a>

### page_up

```rust
fn page_up(self: &Self)
```

Scrolls up by one large change (a page) on a vertical scrollbar.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L789)

<a id="function-page_down"></a>

### page_down

```rust
fn page_down(self: &Self)
```

Scrolls down by one large change (a page) on a vertical scrollbar.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L794)

<a id="function-page_left"></a>

### page_left

```rust
fn page_left(self: &Self)
```

Scrolls left by one large change (a page) on a horizontal scrollbar.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L799)

<a id="function-page_right"></a>

### page_right

```rust
fn page_right(self: &Self)
```

Scrolls right by one large change (a page) on a horizontal scrollbar.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L804)

<a id="function-line_up"></a>

### line_up

```rust
fn line_up(self: &Self)
```

Scrolls up by one small change on a vertical scrollbar.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L809)

<a id="function-line_down"></a>

### line_down

```rust
fn line_down(self: &Self)
```

Scrolls down by one small change on a vertical scrollbar.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L814)

<a id="function-line_left"></a>

### line_left

```rust
fn line_left(self: &Self)
```

Scrolls left by one small change on a horizontal scrollbar.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L819)

<a id="function-line_right"></a>

### line_right

```rust
fn line_right(self: &Self)
```

Scrolls right by one small change on a horizontal scrollbar.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls/primitives/scroll_bar.rs#L824)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`TemplatedControlImplExt`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimplext/)
- [`ControlImplExt`](/docs/0.5.0/api/ferroui-controls/trait-controlimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`InputElementImplExt`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimplext/)
- [`InteractiveImplExt`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimplext/)
- [`LayoutableImplExt`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimplext/)
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- [`VisualImplExt`](/docs/0.5.0/api/ferroui-base/trait-visualimplext/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<ScrollBar>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`LayoutableImpl`](/docs/0.5.0/api/ferroui-base/layout/trait-layoutableimpl/)
- [`InteractiveImpl`](/docs/0.5.0/api/ferroui-base/interactivity/trait-interactiveimpl/)
- [`ControlImpl`](/docs/0.5.0/api/ferroui-controls/trait-controlimpl/)
- [`VisualImpl`](/docs/0.5.0/api/ferroui-base/trait-visualimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`InputElementImpl`](/docs/0.5.0/api/ferroui-base/input/trait-inputelementimpl/)
- [`TemplatedControlImpl`](/docs/0.5.0/api/ferroui-controls/primitives/trait-templatedcontrolimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
