---
title: "CarouselState"
description: "State of the Carousel which allows the user to specify the first item that is shown when the
Carousel is instantiated in the constructor.

It also provides the user with support to pause and resume the auto-scroll behaviour of the
Carousel."
type: "class"
---

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


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

<div class='sourceset sourceset-android'>Android</div>


```kotlin
@ExperimentalTvMaterial3Api
class CarouselState(initialActiveItemIndex: Int = 0)
```


State of the Carousel which allows the user to specify the first item that is shown when the
Carousel is instantiated in the constructor.

It also provides the user with support to pause and resume the auto-scroll behaviour of the
Carousel.

#### Parameters

| | |
| --- | --- |
| initialActiveItemIndex | the index of the first active item |



## Properties

<div class='sourceset sourceset-android'>Android</div>


```kotlin
var activeItemIndex
```


The index of the item that is currently displayed by the carousel



## Functions

```kotlin
fun pauseAutoScroll(itemIndex: Int): ScrollPauseHandle
```


Pauses the auto-scrolling behaviour of Carousel. The pause request is ignored if `itemIndex`
is not the current item that is visible. Returns a `ScrollPauseHandle` that can be used to
resume


## Companion Object

#### Properties

<div class='sourceset sourceset-android'>Android</div>


```kotlin
val Saver: Saver<CarouselState, *>
```


The default `Saver` implementation for `CarouselState`.





