Stylish Fab
A circular floating action button that floats above content with tonal and shadow elevation (floatingElevation, 2 dp). Renders a single icon inside a CircleShape surface with a hairline outline border.
Use for the primary action of a screen (e.g. "create new item"). When iconContent is provided it replaces the default Icon rendered from imageVector and contentDescription, allowing arbitrary composable content such as an animated icon or a badge. When enabled is false, the inner IconButton 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.
Size precedence
Two parameters control the button's diameter: sizeVariant, which maps a named size to the DefaultStylishDimensions fab*Size tokens, and size, which accepts an arbitrary exact diameter. When size is non-null it always wins over sizeVariant; leave size null to use a named variant. Prefer sizeVariant for the standard sizes and size only for bespoke dimensions.
Testing
The root carries the default test tag stylish_fab for UI tests. Callers can override it by passing their own Modifier.testTag(...) in modifier.
Parameters
Icon drawn inside the button when iconContent is null.
Accessibility label for imageVector. Defaults to null (no label); provide one whenever the action is not otherwise described on screen.
Called when the button is tapped.
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 CircleShape.
Predefined size of the button (see StylishFabSize). Ignored when size is non-null.
Exact diameter of the circular surface in dp. When non-null, overrides sizeVariant. Defaults to null.
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), imageVector and contentDescription are used instead.