Extra
FloatingActionButton
A FormaUI floating action button — "Material 3 with better defaults"; one entry point covers all three Material 3 FAB sizes via size, with a default-on press-scale micro-interaction (shared Modifier.formaPressScale) on both FAB composables.
dev.formaui.components.fab
SmallRegularLargeExtended
Preview
This toggle is site chrome only — the preview has its own light/dark switch inside.
Live preview
Live preview — ~37 MB development build
Usage
FormaFloatingActionButton(onClick = { /* create */ }) {
Icon(Icons.Default.Add, contentDescription = "Add")
}
// Extended FAB with a label that can collapse on scroll:
var expanded by remember { mutableStateOf(true) }
FormaExtendedFloatingActionButton(
text = "Compose",
icon = { Icon(Icons.Default.Add, contentDescription = null) },
onClick = { /* compose */ },
expanded = expanded,
)Supporting API
- FormaFabSizeenum
- The size of a FormaFloatingActionButton, mirroring Material 3's three FAB sizes: Small, Regular, Large.
- FormaFabDefaultsobject
- Default values used by both FAB composables; exposes shape (FormaUI's xl corner tier, used across all sizes).
Accessibility
A FAB is icon-only, so its content Icon must carry a contentDescription naming the action — as must FormaExtendedFloatingActionButton's icon, whose text label is hidden while expanded is false. Role.Button semantics and the touch target come from Material 3; the press-scale is a graphicsLayer effect only, so it never shrinks the touch target.