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

mutableStateOf

Return a new MutableState initialized with the passed in value The MutableState class is a single value holder whose reads and writes are observed by Compose.

SimpleStateSample

@Sampled
@Composable
fun SimpleStateSample() {
    val count = remember { mutableStateOf(0) }

    Text(text = "You clicked ${count.value} times")
    Button(onClick = { count.value++ }) { Text("Click me") }
}

DestructuredStateSample

@Sampled
@Composable
fun DestructuredStateSample() {
    val (count, setCount) = remember { mutableStateOf(0) }

    Text(text = "You clicked $count times")
    Button(onClick = { setCount(count + 1) }) { Text("Click me") }
}

observeUserSample

@Suppress("unused")
@Sampled
fun observeUserSample() {

stateSample

@Sampled
fun stateSample() {