API reference

DestructiveButton Function

Used to draw the user's attention to a destructive action such as "Delete Account" or "End the Call". The red color is meant to give users pause before they take the action.

Signature

fun DestructiveButton(
    label: String,
    onClick: () -> Unit,
    leading: () -> Unit? = null,
    isEnabled: Boolean = true,
    expanded: Boolean = false,
)

Parameters

label: String The text to display on the button.
onClick: () -> Unit The callback to invoke when the button is clicked.
leading: (() -> Unit)? An optional icon to display before the label.
isEnabled: Boolean Whether the button is enabled or disabled.
expanded: Boolean Whether the button should be expanded to fill its container.