Skip to content

Commit 51bc807

Browse files
Material Design Teamhunterstich
authored andcommitted
[Docs] Updated Floating action button menus doc to make it more user friendly
PiperOrigin-RevId: 776413842
1 parent 1de779b commit 51bc807

File tree

4 files changed

+42
-18
lines changed

4 files changed

+42
-18
lines changed

docs/components/FloatingActionButtonMenu.md

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,60 @@ iconId: button
77
path: /catalog/floating-action-button-menu/
88
-->
99

10-
# Floating action button menus
10+
# Floating action button (FAB) menu
1111

12-
A [FAB menu](https://m3.material.io/components/fab-menu) opens from a FAB to show
13-
multiple related actions.
12+
A
13+
[floating action button (FAB) menu](https://m3.material.io/components/fab-menu/overview)
14+
opens from a FAB to show 2–6 related actions floating on screen. There is one
15+
FAB menu size for all sizes of FABs.
1416

15-
!["A FAB menu on a screen"](assets/fabmenu/fabmenu_hero.png)
17+
![FAB menu one type.](assets/fabmenu/fabmenu_type.png)
18+
19+
Fab menu is not used with extended FABs and it is available in primary,
20+
secondary, and tertiary color sets.
21+
22+
![A FAB menu on a screen.](assets/fabmenu/fabmenu_hero.png)
23+
24+
Use the FAB menu to show multiple related actions in a prominent, expressive
25+
style. It should always appear in the same place as the FAB that opened it.
1626

1727
## Design & API documentation
1828

1929
* [Material 3 (M3) spec](https://m3.material.io/components/fab-menu/overview)
20-
* [API reference](https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary?hl=en#FloatingActionButtonMenu(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.ui.Alignment.Horizontal,kotlin.Function1))
30+
* [API reference](https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary?hl=en#FloatingActionButtonMenu\(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.ui.Alignment.Horizontal,kotlin.Function1\))
2131

22-
## Using FAB menus
32+
## Anatomy
2333

24-
Use the FAB menu to show multiple related actions in a prominent, expressive
25-
style.
34+
![FAB menu anatomy diagram](assets/fabmenu/fabmenu_anatomy.png)
2635

27-
A FAB menu opens from a FAB to show multiple related actions. It should always
28-
appear in the same place as the FAB that opened it.
36+
1. Close button
37+
2. Menu item
2938

30-
### Anatomy
39+
More details on anatomy items in the
40+
[component guidelines](https://m3.material.io/components/fab-menu/guidelines#eee40b5b-ce91-458e-9005-19db241f074c).
3141

32-
![FAB menu anatomy diagram](assets/fabmenu/fabmenu_anatomy.png)
42+
## M3 Expressive update
3343

34-
When expanded, a FAB menu has a close button and multiple list items.
44+
The FAB menu adds more options to the FAB. It should replace the speed dial and
45+
any usage of stacked small FABs.
46+
[More on M3 Expressive](https://m3.material.io/blog/building-with-m3-expressive)
3547

36-
1. Close button
37-
1. List item
48+
<img src="assets/fabmenu/fabmenu_expressive.png" alt="All size FAB menu expressive" width="700"/>
49+
The FAB menu uses contrasting color and large items to focus attention. It can
50+
open from any size FAB.
51+
52+
**New component added to catalog:**
53+
54+
* One menu size that pairs with any FAB
55+
* Replaces any usage of stacked small FABs
56+
57+
**Color:**
58+
59+
* Contrasting close button and item colors
60+
* Supports dynamic color
61+
* Compatible with any FAB color style
3862

39-
### Usage (via Compose interop)
63+
## Code implementation (via Compose interop)
4064

4165
The FAB menu component is currently not available as a native **Views**
4266
component. This doc shows how to use the **Compose** FAB menu component via the
@@ -45,7 +69,7 @@ Views <-> Compose interop.
4569
Compose API and source code:
4670

4771
* `FloatingActionButtonMenu`
48-
* [API documentation](https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary?hl=en#FloatingActionButtonMenu(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.ui.Alignment.Horizontal,kotlin.Function1))
72+
* [API documentation](https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary?hl=en#FloatingActionButtonMenu\(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.ui.Alignment.Horizontal,kotlin.Function1\))
4973
* [Source code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/FloatingActionButtonMenu.kt)
5074
* [Sample code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/FloatingActionButtonMenuSamples.kt)
5175

@@ -62,7 +86,7 @@ Finally, add a `ComposeView` to your app by following the
6286
[Using Compose in Views](https://developer.android.com/develop/ui/compose/migrate/interoperability-apis/compose-in-views)
6387
interop guide and use the Compose `FloatingActionButtonMenu` within your
6488
`ComposeView`, by referring to the
65-
[API documentation](https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary?hl=en#FloatingActionButtonMenu(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.ui.Alignment.Horizontal,kotlin.Function1))
89+
[API documentation](https://developer.android.com/reference/kotlin/androidx/compose/material3/package-summary?hl=en#FloatingActionButtonMenu\(kotlin.Boolean,kotlin.Function0,androidx.compose.ui.Modifier,androidx.compose.ui.Alignment.Horizontal,kotlin.Function1\))
6690
and
6791
[sample code](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/material3/material3/samples/src/main/java/androidx/compose/material3/samples/FloatingActionButtonMenuSamples.kt).
6892

Loading
-424 KB
Loading
54.5 KB
Loading

0 commit comments

Comments
 (0)