← Components / Actions

FAB

The FAB carries the screen's primary action. The extended FAB springs between its labeled and icon-only forms, for example while scrolling.

SwiftUIReact Native · Coming soonFlutter · Coming soon
++✎ Compose

Usage

SwiftUI
M3EFab("edit") { compose() }
M3EFab("add", size: .large, color: .tertiaryContainer) {}
M3EExtendedFab("edit", label: "Compose", expanded: !scrolled) {}

API

PropertySwiftUIDescription
icon_ icon: StringIcon.
size.baseline .medium .large56 / 80 / 96dp.
colorM3EFabColorprimaryContainer (default), secondary/tertiary containers, or solid roles.
expandedexpanded: BoolExtended FAB only: show the label.

Guidelines

  • One FAB per screen.
  • Collapse the extended FAB while the user scrolls content, and expand it again at rest.