Icon Button

Icon Button

A clickable icon with different styles and shapes.


Installation

./gradlew lumo --add IconButton

Usage

Basic Icon Button

IconButton(
    variant = IconButtonVariant.Primary,
    onClick = { /* Handle click */ }
) {
    Icon(Icons.Default.Star, contentDescription = "Star")
}

Shaped Icon Button

IconButton(
    variant = IconButtonVariant.Primary,
    shape = IconButtonDefaults.ButtonCircleShape,
    onClick = { /* Handle click */ }
) {
    Icon(Icons.Default.Add, contentDescription = "Add")
}

API Documentation

IconButton Variants

TypeVariantDescription
FilledPrimarySolid background with primary color
SecondarySolid background with secondary color
DestructiveSolid background with error color
OutlinedPrimaryOutlinedPrimary color border and icon
SecondaryOutlinedSecondary color border and icon
DestructiveOutlinedError color border and icon
ElevatedPrimaryElevatedPrimary color with elevation
SecondaryElevatedSecondary color with elevation
DestructiveElevatedError color with elevation
GhostPrimaryGhostTransparent with primary colored icon
SecondaryGhostTransparent with secondary colored icon
DestructiveGhostTransparent with error colored icon
GhostTransparent with current content color

Parameters

ParameterTypeDescription
modifierModifierModifier for the button
enabledBooleanWhether the button is enabled
loadingBooleanWhether to show loading state
variantIconButtonVariantStyle variant of the button
shapeShapeShape of the button
onClick() -> UnitCallback when button is clicked
contentPaddingPaddingValuesPadding around the icon
interactionSourceMutableInteractionSourceSource of interactions for the button
content@Composable () -> UnitIcon content to display