# androidx.compose.foundation.text.selection

Common/AllAndroid/JVM

## Classes

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/SelectionState` | Selection state object for a particular `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/SelectionContainer.composable#SelectionContainer(androidx.compose.ui.Modifier,kotlin.Function0)`. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/TextSelectionColors` | Represents the colors used for text selection by text and text field components. | Cmn |

## Composables

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/DisableSelection.composable` | Disables text selection for its direct or indirect children. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/SelectionContainer.composable` | Enables text selection for its direct or indirect children. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/rememberSelectionState.composable` | Create and remember a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/SelectionState`. | Cmn |

## Top-level properties summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ProvidableCompositionLocal<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html>` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/package-summary#LocalTextClassifierCoroutineContext()` The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html` used for launching `https://developer.android.com/reference/android/view/textclassifier/TextClassifier.html` operations within the selection features. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/ProvidableCompositionLocal<https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/TextSelectionColors>` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/package-summary#LocalTextSelectionColors()` CompositionLocal used to change the `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/TextSelectionColors` used by text and text field components in the hierarchy. | Cmn |

## Top-level properties

### LocalTextClassifierCoroutineContext

android 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/PlatformSelectionBehaviors.android.kt+symbol:LocalTextClassifierCoroutineContext)

```
val LocalTextClassifierCoroutineContext: ProvidableCompositionLocal<CoroutineContext>
```

The `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html` used for launching `https://developer.android.com/reference/android/view/textclassifier/TextClassifier.html` operations within the selection features.

This context is expected to be associated with a worker thread to ensure that text classification, which can be a time-consuming operation, does not block the UI thread. Providing a `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.coroutines/-coroutine-context/index.html` not backed by a worker thread may lead to performance issues or unexpected behavior with `https://developer.android.com/reference/android/view/textclassifier/TextClassifier.html`.

### LocalTextSelectionColors

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/TextSelectionColors.kt+symbol:LocalTextSelectionColors) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.0.0)

```
val LocalTextSelectionColors: ProvidableCompositionLocal<TextSelectionColors>
```

CompositionLocal used to change the `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/selection/TextSelectionColors` used by text and text field components in the hierarchy.