Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
Android docs
FormsAndroid

Checkbox group

Choose any number of related options under one label.

Public APILumenCheckboxGroupAndroid / Compose

Native example

Use Checkbox group

Use it for several choices from a short list. Show the error on the group, not on each option.

Checkbox group rendered in the Android phone emulator Lumen playground
Captured exampleAndroid phone emulatorView dark appearance
kotlin
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
    )
}
Android
A required group of delivery channels that shows an error when nothing is selected.

Reference

Public API

The primary shared and platform-specific options exposed by LumenCheckboxGroup.

APIValues or typeDefaultDescription
options / selected / orientationchoices / selected values / layoutrequired / required / verticalUse it for several choices from a short list.

Native behavior

Design and accessibility

When to use it

Use it for several choices from a short list. Show the error on the group, not on each option.

Accessibility

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

Available on other platforms

React NativeApple / SwiftUI Web
Android docsCompose module