Stylish Extended Fab
A pill-shaped floating action button that pairs an icon with a text label, floating above content with tonal and shadow elevation. Renders a horizontal Row of icon + label inside a RoundedCornerShape surface with a hairline outline border.
Use for the primary action of a screen when the action benefits from a descriptive label (e.g. "Compose", "Create New", "Add Item"). When iconContent is provided it replaces the default Icon rendered from icon and contentDescription, allowing arbitrary composable content such as an animated icon or a badge. When enabled is false, the button rejects clicks and Material applies its disabled alpha.
While pressed, the shadow elevation animates down to 0 dp (using StylishTheme.animation.durationShort), matching the standard Material FAB pressed behavior. Additionally, 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.
Testing
The root carries the test tag stylish_extended_fab for UI tests. Callers can override it by passing their own Modifier.testTag(...) in modifier.
Parameters
Label text displayed alongside the icon.
Icon drawn at the start of the button when iconContent is null.
Accessibility label for icon. Defaults to null (no label); provide one whenever the action is not otherwise described on screen.
Called when the button is tapped.
Modifier applied to the root surface.
When false, the button ignores pointer input and renders with Material's disabled treatment.
Background color of the surface. Defaults to MaterialTheme.colorScheme.surfaceContainerHigh.
Default tint for content inside the surface. Defaults to MaterialTheme.colorScheme.onSurface.
Shape of the surface. Defaults to a pill shape using StylishTheme.dimensions.floatingCornerRadius.
Border stroke around the surface. Defaults to a hairline of StylishTheme.dimensions.outlineWidth (0.4 dp) using MaterialTheme.colorScheme.outlineVariant.
Tonal elevation of the surface. Defaults to StylishTheme.dimensions.floatingElevation.
Shadow elevation of the surface when not pressed. Defaults to StylishTheme.dimensions.floatingElevation; while pressed the shadow animates to 0 dp.
The MutableInteractionSource for the button, used to observe press/focus/hover interactions (and to drive the pressed-state shadow animation). When null, an internal one is remembered.
Optional slot that replaces the default Icon. When null (default), icon and contentDescription are used instead.
Controls whether the button is visible or hidden (e.g. in response to scroll). Defaults to VisibilityState.AlwaysVisible.