Icon Button

Display a button with an icon for the content

View in Playground

Constructors

@Composable
fun IconButton(
    onClick: () -> Unit,
    modifier: Modifier = Modifier,
    icon: @Composable () -> Unit
)
  • onClick – callback used for when the button is clicked
    • required
  • modifier – the modifier to be applied

  • icon – the icon to be displayed on the button
    • required

Examples

Displaying an Icon Button

IconButton(onClick = {

}, icon = {
    Icon(asset = Icons.Default.Person)
})