# IScrollable

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-base/input/trait-iscrollable/

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

```rust
trait IScrollable
```

Interface implemented by scrollable controls.

Upstream this contract lives with the control primitives; it is defined
here because directional navigation is its only consumer in the base
library so far. An input element exposes it through the
`as_scrollable` virtual member of `InputElement`.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_scrollable.rs#L9)

## Members

- [`extent`](#function-extent)
- [`offset`](#function-offset)
- [`set_offset`](#function-set_offset)
- [`viewport`](#function-viewport)
- [`can_horizontally_scroll`](#function-can_horizontally_scroll)
- [`can_vertically_scroll`](#function-can_vertically_scroll)

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

### extent

```rust
fn extent(self: &Self) -> Size
```

The extent of the scrollable content, in logical units.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_scrollable.rs#L11)

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

### offset

```rust
fn offset(self: &Self) -> Vector
```

The current scroll offset, in logical units.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_scrollable.rs#L14)

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

### set_offset

```rust
fn set_offset(self: &Self, value: Vector)
```

Sets the current scroll offset, in logical units.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_scrollable.rs#L17)

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

### viewport

```rust
fn viewport(self: &Self) -> Size
```

The size of the viewport, in logical units.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_scrollable.rs#L20)

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

### can_horizontally_scroll

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

Whether the content can be scrolled horizontally.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_scrollable.rs#L23)

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

### can_vertically_scroll

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

Whether the content can be scrolled vertically.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Base/input/i_scrollable.rs#L26)

## Availability

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