Checkboxes
Checkbox selection control allows the user to select options.
Use checkboxes to:
- Select one or more options from a list
- Present a list containing sub-selections
- Turn an item on or off in a desktop environment
On this page
Specifications references
Accessibility
Please follow accessibility criteria for development.
Checkboxes support content labeling for accessibility and are readable by most screen readers, such as TalkBack. Text rendered in check boxes is automatically provided to accessibility services. Additional content labels are usually unnecessary.
Implementation
Jetpack Compose
In your composable screen you can use:
var checked by remember { mutableStateOf(false) }
OdsCheckbox(
checked = checked,
onCheckedChange = { checked = it },
enabled = true
)
OdsCheckbox API
Parameter | Default value | Description |
---|---|---|
checked: Boolean |
Controls checked state of the checkbox | |
onCheckedChange: ((Boolean) -> Unit)? |
Callback invoked on checkbox click. If null , then this is passive and relies entirely on a higher-level component to control the checked state. |
|
modifier: Modifier |
Modifier |
Modifier applied to the checkbox |
enabled: Boolean |
true |
Controls enabled state of the checkbox. When false , this checkbox will not be clickable. |