@@ -13,17 +13,13 @@ path: /catalog/buttons/
13
13
organize buttons and add interactions between them.There are two variants of a
14
14
button group.
15
15
16
- ![ 2 types of button groups] ( assets/buttons/buttongroup_types .png )
16
+ ![ 2 types of button groups] ( assets/buttons/buttongroup-types .png )
17
17
18
18
1 . Standard button group
19
19
2 . Connected button group
20
20
21
21
** Note:** Images use various dynamic color schemes.
22
22
23
- ** Note:** ` <Button> ` is auto-inflated as
24
- ` <com.google.android.material.button.MaterialButton> ` via
25
- ` MaterialComponentsViewInflater ` when using a ` Theme.Material3.* ` theme.
26
-
27
23
## Design & API documentation
28
24
29
25
* [ Material 3 (M3) spec] ( https://m3.material.io/components/button-groups/overview )
@@ -34,25 +30,27 @@ button group.
34
30
Button groups are invisible containers that add padding between buttons and
35
31
modify button shape. They don’t contain any buttons by default.
36
32
37
- ![ Anatomy of a button group] ( assets/buttons/buttongroup_anatomy .png )
33
+ ![ Anatomy of a button group] ( assets/buttons/buttongroup-anatomy .png )
38
34
39
35
1 . Container
40
36
41
37
More details on anatomy items in the
42
38
[ component guidelines] ( https://m3.material.io/components/button-groups/guidelines#8fcef838-b0f2-4663-9df5-a8c140822fa6 ) .
43
39
44
- ## M3 Expressive update
40
+ ## M3 Expressive
41
+
42
+ ### M3 Expressive update
45
43
46
44
Before you can use ` Material3Expressive ` component styles, follow the
47
45
[ ` Material3Expressive ` themes setup instructions] ( https://github.com/material-components/material-components-android/tree/master/docs/getting-started.md#material3expressive-themes ) .
48
46
49
- <img src =" assets/buttons/buttongroup_expressive .png " alt =" Standard button group in 3 of 5 available sizes, and segmented button group with just icon buttons and just common buttons. " height =" 500 " />
47
+ <img src =" assets/buttons/buttongroup-expressive .png " alt =" Standard button group in 3 of 5 available sizes, and segmented button group with just icon buttons and just common buttons. " height =" 500 " />
50
48
51
49
Button groups apply shape, motion, and width changes to buttons and icon buttons
52
50
to make them more interactive.
53
51
[ More on M3 Expressive] ( https://m3.material.io/blog/building-with-m3-expressive )
54
52
55
- New component added to catalog .
53
+ Button groups are new components added in Expressive .
56
54
57
55
** Types and naming:**
58
56
@@ -65,6 +63,15 @@ New component added to catalog.
65
63
* Works with all button sizes: XS, S, M, L, and XL
66
64
* Applies default shape to all buttons: round or square
67
65
66
+ ### M3 Expressive styles
67
+
68
+ Default styles in the expressive themes:
69
+
70
+ - Standard button group:
71
+ ` Widget.Material3Expressive.MaterialButtonGroup `
72
+ - Connected button group:
73
+ ` Widget.Material3Expressive.MaterialButtonGroup.Connected `
74
+
68
75
## Key properties
69
76
70
77
### Shape and size attributes
@@ -102,7 +109,7 @@ Element | Style | Theme
102
109
The standard button group contains multiple related individual buttons. The
103
110
individual button's shape is preserved.
104
111
105
- ![ Examples of using standard button group] ( assets/buttons/standard_button_group .png )
112
+ ![ Examples of using standard button group] ( assets/buttons/standard-button-group .png )
106
113
107
114
#### Button group examples
108
115
@@ -154,7 +161,7 @@ In addition to standard button groups, connected button group also overrides the
154
161
individual button's shape to make them visually more belong to a group with 2dp
155
162
spacing, 8dp inner corners, and fully rounded outer corners.
156
163
157
- ![ Examples of using connected button group] ( assets/buttons/connected_button_group .png )
164
+ ![ Examples of using connected button group] ( assets/buttons/connected-button-group .png )
158
165
159
166
#### Connected button group examples
160
167
@@ -207,6 +214,10 @@ Material components for Android library. For more information, go to the
207
214
[ Getting started] ( https://github.com/material-components/material-components-android/tree/master/docs/getting-started.md )
208
215
page.
209
216
217
+ ** Note:** ` <Button> ` is auto-inflated as
218
+ ` <com.google.android.material.button.MaterialButton> ` via
219
+ ` MaterialComponentsViewInflater ` when using a ` Theme.Material3.* ` theme.
220
+
210
221
### Making button groups adaptive
211
222
212
223
` MaterialButtonGroup ` inherits from the ` LinearLayout ` . It can be configured to
@@ -220,7 +231,7 @@ screens by using `layout_width` and `layout_weight`.
220
231
When child buttons should not be adjusted while screen size changes, consider
221
232
using ` layout_width ` on all buttons.
222
233
223
- ![ Button group with fixed arrangement] ( assets/buttons/group_arrangement_fixed .png )
234
+ ![ Button group with fixed arrangement] ( assets/buttons/group-arrangement-fixed .png )
224
235
225
236
``` xml
226
237
<com .google.android.material.button.MaterialButtonGroup
@@ -265,7 +276,7 @@ using `layout_width` on all buttons.
265
276
When all child buttons are equally important or their sizes are proportional to
266
277
each other, consider using ` layout_weight ` on all buttons.
267
278
268
- ![ Button group with flexible arrangement] ( assets/buttons/group_arrangement_flexible .png )
279
+ ![ Button group with flexible arrangement] ( assets/buttons/group-arrangement-flexible .png )
269
280
270
281
``` xml
271
282
<com .google.android.material.button.MaterialButtonGroup
@@ -313,7 +324,7 @@ each other, consider using `layout_weight` on all buttons.
313
324
When only some buttons are flexible for different screen sizes, consider using
314
325
` layout_weight ` on these buttons but use ` layout_width ` on the rest as below.
315
326
316
- ![ Button group with mixed arrangement] ( assets/buttons/group_arrangement_mixed .png )
327
+ ![ Button group with mixed arrangement] ( assets/buttons/group-arrangement-mixed .png )
317
328
318
329
``` xml
319
330
<com .google.android.material.button.MaterialButtonGroup
0 commit comments