API reference

IconButton Composable

Displays a circular icon-only button for toolbars and compact actions.

Signature

@Composable
fun IconButton(
    icon: @Composable () -> Unit,
    onClick: () -> Unit,
    contentDescription: String?,
    modifier: Modifier = Modifier,
    style: ButtonStyle = ButtonStyle.Primary,
    enabled: Boolean = true,
    dimensions: ButtonDimensions = UiSetTheme.dimensions.buttons,
    interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
    indication: UiSetIndicationSpec? =
        UiSetTheme.indications.standard.forContext(style.interactionColorContext),
)

Parameters

icon: @Composable () -> Unit icon content
onClick: () -> Unit callback invoked when the button is activated
contentDescription: String? accessibility label for the icon-only action, when available
modifier: Modifier modifier applied to the full interaction target
style: ButtonStyle semantic button colors and border treatment
enabled: Boolean whether the button accepts input
dimensions: ButtonDimensions visual diameter and icon size
interactionSource: MutableInteractionSource interaction stream shared with callers observing button state
indication: UiSetIndicationSpec? press, hover, and focus indication drawn inside the visual container