ToggleButton

fun ToggleButton(text: String, onCheckedChanged: (Boolean) -> Unit, modifier: Modifier = Modifier, checked: Boolean = true, enabled: Boolean = true, colors: ToggleButtonColors = ToggleButtonDefaults.toggleButtonColors(), interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, shape: Shape = CircleShape, role: Role = ToggleButtonDefaults.DefaultRole, smallSize: Boolean = false)

This component is an alternative to ToggleButton, providing the following:

  • a convenient way of providing text;


fun ToggleButton(checkedIcon: PaintableIcon, notCheckedIcon: PaintableIcon, contentDescription: String, onCheckedChanged: (Boolean) -> Unit, modifier: Modifier = Modifier, checked: Boolean = true, enabled: Boolean = true, colors: ToggleButtonColors = ToggleButtonDefaults.toggleButtonColors(), interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }, shape: Shape = CircleShape, role: Role = ToggleButtonDefaults.DefaultRole, iconRtlMode: IconRtlMode = IconRtlMode.Default, smallSize: Boolean = false)

§ This component is an alternative to ToggleButton, providing the following:

  • a convenient way of providing a icons for the checked and not checked states;