IconButton

fun IconButton(iconPainter: Painter, onClick: () -> Unit, modifier: Modifier = Modifier, buttonType: ButtonType = ButtonType.Primary, isEnabled: Boolean = true, interactionSource: MutableInteractionSource = remember { MutableInteractionSource() })

Icon button

Buttons are used to initialize an action. Button labels express what action will occur when the user interacts with it.

Icon buttons allow users to take actions, and make choices, with a single tap. Icon buttons can take the form of a primary, secondary, tertiary, or ghost variant but most commonly will be styled as primary or ghost buttons.

(From Button documentation)

Parameters

iconPainter

Icon painter to be displayed in the button.

onClick

Callback invoked when the button is clicked.

modifier

The modifier to be applied to the button.

buttonType

A ButtonType that defines the button's type.

isEnabled

Whether the button is enabled or disabled.

interactionSource

The MutableInteractionSource that keeps track of the button's state.

See also