Accessibility state - Jetpack Compose

In Jetpack Compose, you can use the semantics modifier to set various accessibility properties.

You can set an accessibility state by using the stateDescription property. You can also use the selected property to indicate a selected state.

Box(
    modifier = Modifier.semantics {
        // Custom state
        stateDescription = "Expanded"

        // Selected
        selected = true
    }
)