Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
LabelledRadioButton
@Composable
fun LabelledRadioButton(
selected: Boolean,
onClick: () -> Unit,
label: String,
modifier: Modifier = Modifier
) {
Row(
verticalAlignment = Alignment.CenterVertically,
modifier = modifier
.clip(MaterialTheme.shapes.small)
.clickable(
indication = rememberRipple(color = MaterialTheme.colors.primary),
interactionSource = remember { MutableInteractionSource() },
onClick = onClick
)
.requiredHeight(ButtonDefaults.MinHeight)
.padding(4.dp)
) {
RadioButton(
selected = selected,
onClick = null
)
Spacer(Modifier.size(8.dp))
Text(
text = label,
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment