SelectionStateSample
@Composable
fun SelectionStateSample() {
val selectionState = rememberSelectionState()
val characterCount = selectionState.selectedTexts.sumOf { it.text.length }
Column {
SelectionContainer(state = selectionState) {
Column { BasicText(text = "Text to be selected...") }
}
if (characterCount > 0) {
BasicText(text = "Characters selected: $characterCount")
}
}
}