<fab>
A floating action button over the screen's corner, with an icon and an optional label.
<screen>
<app-bar title="Notes"/>
<main>
<column style="w-full p-16 gap-8">
<text style="font-bold">Groceries</text>
<text style="muted">Oat milk, eggs, sourdough</text>
</column>
</main>
<fab id="new-note"
icon="edit"
label="New note"
color="teal"/>
</screen>
Attributes
| Name | What it does | Default |
|---|---|---|
color |
Background color color |
|
elevation |
Shadow elevation number |
6 |
icon |
Icon name string |
add |
icon-color |
Icon/text color color |
white |
icon-size |
Explicit icon size override number |
|
id |
Registry ID (same id replaces, different ids stack) string |
|
label |
Text label (extended FAB) string |
|
preview |
Render inline instead of hoisting to Scaffold boolean |
false |
shape |
Button shape circle, rounded, square, default |
default |
size |
FAB size, each step bigger: xs 40, sm 48, md 56, lg 72, xl 96, 2xl 112, 3xl 128, 4xl 144 dp. A labeled FAB takes the same height. xs, sm, md, lg, xl, 2xl, 3xl, 4xl |
md |
tooltip |
Accessibility tooltip string |
Any tag also takes gestures: @on.tap, @on.longpress, @on.doubletap and @on.swipeleft (and right, up and down). @click runs on a tap too.