@@ -7,36 +7,60 @@ iconId: button
7
7
path: /catalog/floating-action-button-menu/
8
8
-->
9
9
10
- # Floating action button menus
10
+ # Floating action button (FAB) menu
11
11
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.
14
16
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.
16
26
17
27
## Design & API documentation
18
28
19
29
* [ 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\ ) )
21
31
22
- ## Using FAB menus
32
+ ## Anatomy
23
33
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 )
26
35
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
29
38
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 ) .
31
41
32
- ![ FAB menu anatomy diagram ] ( assets/fabmenu/fabmenu_anatomy.png )
42
+ ## M3 Expressive update
33
43
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 )
35
47
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
38
62
39
- ### Usage (via Compose interop)
63
+ ## Code implementation (via Compose interop)
40
64
41
65
The FAB menu component is currently not available as a native ** Views**
42
66
component. This doc shows how to use the ** Compose** FAB menu component via the
@@ -45,7 +69,7 @@ Views <-> Compose interop.
45
69
Compose API and source code:
46
70
47
71
* ` 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\ ) )
49
73
* [ Source code] ( https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/material3/material3/src/commonMain/kotlin/androidx/compose/material3/FloatingActionButtonMenu.kt )
50
74
* [ 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 )
51
75
@@ -62,7 +86,7 @@ Finally, add a `ComposeView` to your app by following the
62
86
[ Using Compose in Views] ( https://developer.android.com/develop/ui/compose/migrate/interoperability-apis/compose-in-views )
63
87
interop guide and use the Compose ` FloatingActionButtonMenu ` within your
64
88
` 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\ ) )
66
90
and
67
91
[ 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 ) .
68
92
0 commit comments