Material 3 Expressive introduces ButtonGroup, a new composable for displaying horizontal button collections with built-in animations and overflow handling. The component supports clickable buttons, single and multi-select toggles, and connected button groups (replacing deprecated segmented buttons). ButtonGroup automatically handles width animations through animateWidth modifier and MutableInteractionSource, expanding pressed buttons while compressing neighbors. The API provides helper functions (clickableItem, toggleableItem, customItem) within ButtonGroupScope, customizable expansion ratios, and overflow indicators. Connected button groups use specific shapes from ButtonGroupDefaults and can wrap across multiple lines with FlowRow. Currently experimental, requiring opt-in annotation.
Table of contents
Composing the ButtonGroupSingle-Select Toggle ButtonsMulti-Select Toggle ButtonsConnected Button GroupsConnected Button Groups with FlowRowCustomising the Expansion RatioSort: