# rememberSelectionState

Common/AllAndroid/JVM

## Functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/SelectionState` | `@https://developer.android.com/reference/kotlin/androidx/compose/runtime/Composable https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/rememberSelectionState.composable#rememberSelectionState()()` Create and remember a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/SelectionState`. | Cmn |

## Functions

### rememberSelectionState

Cmn Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/text/selection/SelectionState.kt+function:rememberSelectionState) Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.12.0)

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

Create and remember a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/SelectionState`. The state is remembered using `https://developer.android.com/reference/kotlin/androidx/compose/runtime/saveable/rememberSaveable.composable#rememberSaveable(kotlin.Array,androidx.compose.runtime.saveable.Saver,kotlin.String,kotlin.Function0)` and will be saved and restored with the composition.

If you need to store a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/SelectionState` in another object, use the `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/SelectionState#Saver()` object to manually save and restore the state.