Button

Displays a button or a component that looks like a button.

Button is a pressable component that supports six visual variants (Default, Destructive, Outline, Secondary, Ghost, Link) and six size presets. It has built-in loading and disabled states, an optional full-width layout, and a dedicated IconButton composable for icon-only use cases.

Default

Destructive

Secondary

Ghost

Outline

Icon

Use IconButton for icon-only buttons. It defaults to ButtonVariant.Ghost and ButtonSize.Icon.

With Icon

API Reference

Button

ParameterTypeDefaultDescription
onClick() -> UnitCalled when the button is pressed
modifierModifierModifierModifier applied to the button
variantButtonVariantButtonVariant.DefaultVisual style of the button
sizeButtonSizeButtonSize.DefaultSize preset controlling padding and minimum height
enabledBooleantrueWhen false, the button is non-interactive and visually dimmed
loadingBooleanfalseWhen true, shows a spinner and disables interaction
fullWidthBooleanfalseWhen true, the button fills the available width
shapeShapeRoundedCornerShape(radius.md)Shape of the button container
contentPaddingPaddingValues?nullOverrides size-derived content padding when non-null
colorButtonColors?nullOverrides variant-derived colors when non-null
content@Composable RowScope.() -> UnitContent displayed inside the button

IconButton

A convenience composable for icon-only buttons. Thin wrapper around Button with variant = ButtonVariant.Ghost and size = ButtonSize.Icon as defaults.

ParameterTypeDefaultDescription
onClick() -> UnitCalled when the button is pressed
modifierModifierModifierModifier applied to the button
variantButtonVariantButtonVariant.GhostVisual style of the button
sizeButtonSizeButtonSize.IconSize preset
enabledBooleantrueWhen false, the button is non-interactive and visually dimmed
shapeShapeRoundedCornerShape(radius.md)Shape of the button container
colorButtonColors?nullOverrides variant-derived colors when non-null
content@Composable RowScope.() -> UnitIcon content displayed inside the button

ButtonVariant

ValueDescription
DefaultFilled with the primary color
DestructiveFilled with the destructive/danger color
OutlineTransparent fill with a border
SecondaryFilled with the secondary color
GhostNo fill or border; accent background appears on press
LinkNo fill or border; text is underlined

ButtonSize

ValueMin sizeDescription
Default40 dp heightStandard size
Sm36 dp heightSmall
Xs32 dp heightExtra small
Lg44 dp heightLarge
Icon36 × 36 dpSquare; for icon-only buttons
IconSm28 × 28 dpSmall square; for compact icon-only buttons
Edit this page on GitHub