---
title: "rememberSelectionState"
description: "Create and remember a SelectionState."
type: "composable"
lastmod: "2026-05-20T01:13:53.287158Z"
---
## API Reference

### rememberSelectionState

> Source set: Common

```kotlin
@Composable
fun rememberSelectionState(): SelectionState
```

Create and remember a [SelectionState](/jetpack-compose/androidx.compose.foundation/foundation/classes/SelectionState). The state is remembered using [rememberSaveable](/jetpack-compose/androidx.compose.runtime/runtime-saveable/composable-functions/rememberSaveable) and will
be saved and restored with the composition.

If you need to store a [SelectionState](/jetpack-compose/androidx.compose.foundation/foundation/classes/SelectionState) in another object, use the [SelectionState.Saver](/jetpack-compose/androidx.compose.runtime/runtime-saveable/interfaces/Saver) object
to manually save and restore the state.
