RadioButtonLabelled

fun RadioButtonLabelled(selected: Boolean, onClick: () -> Unit?, modifier: Modifier = Modifier, intent: ToggleIntent = ToggleIntent.Basic, enabled: Boolean = true, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, contentSide: ContentSide = ContentSide.End, content: @Composable RowScope.() -> Unit)

Radio buttons allow users to select one option from a set.

  • Use radio buttons to select a single option from a list

  • It should be visible at a glance if a radio button has been selected, and selected items should be more visually prominent than unselected items.

  • Present a list showing all available options. If available options can be collapsed, consider using a dropdown menu because it uses less space.

Parameters

selected

whether this radio button is selected or not

onClick

callback to be invoked when the RadioButton is clicked. If null, then this RadioButton will not handle input events, and only act as a visual indicator of selected state

modifier

Modifier to be applied to the layout of the checkbox

intent

The ToggleIntent to use to draw the radio button

enabled

whether the component is enabled or grayed out

interactionSource

the MutableInteractionSource representing the stream of Interactions for this RadioButton. You can create and pass in your own remembered MutableInteractionSource if you want to observe Interactions and customize the appearance / behavior of this RadioButton in different Interactions.

contentSide

The side where we want to show the label, default to ContentSide.End.

content

The content displayed after the radio button, usually a Text composable shown at the end.

See also

if you require color customization between states. Be aware that this is still an internal composable so if you need such state contact the Spark team