by @alexstyl
✉️ Leave your feedback

← Back to Material 3 Compose

IconToggleButton

Component
in
Material 3
. Since 1.0.0

Overview

Examples

Community Notes

Video

@Composable
fun IconToggleButtonSample() {
    var checked by remember { mutableStateOf(false) }
    IconToggleButton(checked = checked, onCheckedChange = { checked = it }) {
        if (checked) {
            Icon(Icons.Filled.Lock, contentDescription = "Localized description")
        } else {
            Icon(Icons.Outlined.Lock, contentDescription = "Localized description")
        }
    }
}
Previous ComponentIconButton
Next ComponentInputChip