🌈 Create new beautiful Compose Gradients with our new wesite ->
Composable Function

SelectionContainer

Enables text selection for its direct or indirect children.

SelectionSample

@Sampled
@Composable
fun SelectionSample() {
    SelectionContainer {
        Column {
            Text("Text 1")
            Text("Text 2")
            Text("טקסט 3")
        }
    }
}

SelectAllSample

@Sampled
@Composable
fun SelectAllSample() {
    val selectionState = rememberSelectionState()

    Column {
        Button(onClick = { selectionState.selectAll() }) { BasicText("Select All") }
        SelectionContainer(state = selectionState) { BasicText(text = "Text to be selected...") }
    }
}

Content updated: