When to use it
Use it for several choices from a short list. Show the error on the group, not on each option.
Native example
Use it for several choices from a short list. Show the error on the group, not on each option.
import androidx.compose.runtime.*
import com.santi020k.lumen.*
@Composable
fun DeliveryMethods() {
var selected by remember { mutableStateOf(setOf("email")) }
LumenCheckboxGroup(
label = "Delivery methods",
options = listOf(
LumenSelectionOption("email", "Email", "A daily summary"),
LumenSelectionOption("push", "Push notifications"),
LumenSelectionOption("sms", "SMS", enabled = false)
),
selected = selected,
onSelectedChange = { selected = it },
description = "Choose every channel you want to use.",
required = true,
errorMessage = if (selected.isEmpty()) "Choose at least one delivery method." else null
)
}Reference
The primary shared and platform-specific options exposed by LumenCheckboxGroup.
| API | Values or type | Default | Description |
|---|---|---|---|
| options / selected / orientation | choices / selected values / layout | required / required / vertical | Use it for several choices from a short list. |
Native behavior
Use it for several choices from a short list. Show the error on the group, not on each option.
The group has a visible label and error hint; each checkbox also reads the group name, requirement, and error alongside its own description.
Shared component