<div class='type'>Interface</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>



```kotlin
interface BringIntoViewSpec
```


The configuration of how a scrollable reacts to bring into view requests.

Check the following sample for a use case usage of this API:


## Properties

<div class='sourceset sourceset-common'>Common</div>


> **Deprecated** Animation spec customization is no longer supported.

```kotlin
val scrollAnimationSpec: AnimationSpec<Float>
```


An Animation Spec to be used as the animation to run to fulfill the BringIntoView requests.



## Functions



<h2 id="calculatescrolldistance-offset-size-containersize">calculateScrollDistance</h2>

```kotlin
fun calculateScrollDistance(offset: Float, size: Float, containerSize: Float): Float
```


Calculate the offset needed to bring one of the scrollable container's child into view. This
will be called for every frame of the scrolling animation. This means that, as the animation
progresses, the offset will naturally change to fulfill the scroll request.

All distances below are represented in pixels.

#### Parameters

| | |
| --- | --- |
| offset | from the side closest to the start of the container. |
| size | is the child size. |
| containerSize | Is the main axis size of the scrollable container. |


#### Returns

| | |
| --- | --- |
|  | The necessary amount to scroll to satisfy the bring into view request. Returning zero from here means that the request was satisfied and the scrolling animation should stop. |