StylishIconButton

fun StylishIconButton(imageVector: ImageVector, contentDescription: String? = null, onClick: () -> Unit, modifier: Modifier = Modifier, enabled: Boolean = true, active: Boolean = false, containerColor: Color? = null, contentColor: Color? = null, shape: Shape? = null, border: BorderStroke? = BorderStroke( StylishTheme.dimensions.outlineWidth, MaterialTheme.colorScheme.outlineVariant, ), minWidth: Dp = DefaultStylishDimensions.iconButtonMinSize, minHeight: Dp = DefaultStylishDimensions.iconButtonMinSize, interactionSource: MutableInteractionSource? = null, iconContent: @Composable () -> Unit? = null)

A circular icon button rendered on an outlined surface with a subtle shadow. Supports an active state that inverts the color scheme to primary/onPrimary, suitable for toggle-style controls.

When active is true, the container defaults to MaterialTheme.colorScheme.primary and the content color to onPrimary. When inactive, the container defaults to surfaceContainerHighest and the content to onSurfaceVariant. Explicit containerColor / contentColor overrides always win. When enabled is false, the shadow elevation drops to zero, the content is dimmed to 38 % opacity, the button is announced as disabled via semantics, and the inner IconButton rejects clicks. When enabled, a Material-style state layer (see Modifier.stylishStateLayer) darkens the surface on hover and press, and a primary-colored focus ring (see Modifier.stylishFocusRing) is drawn while the button holds keyboard focus.

Parameters

imageVector

Icon drawn inside the button when iconContent is null.

contentDescription

Accessibility label for imageVector. Defaults to null (no label); provide one whenever the action is not otherwise described on screen.

onClick

Called when the button is tapped.

enabled

When false, the button ignores pointer input, the shadow elevation is removed, the content is dimmed to 38 % opacity, and the button is announced as disabled.

active

When true, the button renders in the primary color scheme to indicate a selected/toggled state.

containerColor

Background color override. When null, resolved from active (see above).

contentColor

Content tint override. When null, resolved from active (see above). When enabled is false, the resolved content color is dimmed to 38 % opacity.

shape

Shape of the surface. Defaults to CircleShape.

border

Border stroke drawn around the surface. Defaults to a hairline of StylishTheme.dimensions.outlineWidth using MaterialTheme.colorScheme.outlineVariant. Pass null for no border.

minWidth

Minimum width of the tappable surface. Defaults to DefaultStylishDimensions.iconButtonMinSize.

minHeight

Minimum height of the tappable surface. Defaults to DefaultStylishDimensions.iconButtonMinSize.

interactionSource

The MutableInteractionSource for the button, used to observe press/focus/hover interactions. When null, an internal one is remembered.

iconContent

Optional slot that replaces the default Icon. When null (default), imageVector and contentDescription are used instead. When provided, contentColor is not applied automatically — the slot is responsible for its own tinting.

See also