StylishRoundedIconButton

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

A pill-shaped icon button rendered on a wide rounded-rectangle surface. Behaves like StylishIconButton but uses a horizontally elongated shape, making it a good fit for toolbars or action rows where a wider tap target is desirable.

The active / enabled color and elevation logic mirrors StylishIconButton: active inverts to primary/onPrimary, and disabling removes the shadow. 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. When enabled is false, the icon is rendered inside a plain Box instead of an IconButton, so no ripple or click handling is attached; the box is announced as disabled and carries the contentDescription via semantics.

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. Ignored when enabled is false.

enabled

When false, the button ignores pointer input, the shadow elevation is removed, the icon is rendered in a non-interactive Box, 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: primary if active, otherwise surfaceContainerHighest.

contentColor

Content tint override. When null, resolved from active: onPrimary if active, otherwise onSurfaceVariant.

shape

Shape of the surface. Defaults to RoundedCornerShape with DefaultStylishDimensions.floatingCornerRadius.

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.roundedIconButtonMinWidth.

minHeight

Minimum height of the tappable surface. Defaults to 48 dp.

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