RadioButton

fun RadioButton(selected: Boolean, label: String, onClick: () -> Unit?, modifier: Modifier = Modifier, interactiveState: SelectableInteractiveState = SelectableInteractiveState.Default, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() })

Carbon Radio button

Radio buttons are used for mutually exclusive choices, not for multiple choices. Only one radio button can be selected at a time. When a user chooses a new item, the previous choice is automatically deselected.

Anatomy

The radio button component is comprised of a set of clickable circles (the inputs) with text labels positioned to the right. If there is a group of radio buttons, a group label can be added.

(From Radio button documentation)

Parameters

selected

Whether the radio button is selected.

label

The text to be displayed next to the radio button.

onClick

Callback invoked when the radio button is clicked.

modifier

The modifier to be applied to the radio button.

interactiveState

The SelectableInteractiveState of the radio button.

interactionSource

The MutableInteractionSource that keeps track of the radio button state.