How to use Material 3 Expressive in Jetpack Compose
Short answer: set material3 to 1.5.0-beta02, wrap your app in MaterialExpressiveTheme,
and use the Expressive components (ButtonGroup, FloatingActionButtonMenu,
HorizontalFloatingToolbar …). In beta02 almost none of them need an opt-in.
Why it isn’t just “update Compose”
Section titled “Why it isn’t just “update Compose””M3 Expressive shipped in Compose as part of material3 1.5.0. In the stable 1.4.0, the
Expressive theme, motion scheme and emphasized type exist but are internal, and most new
components aren’t there. A Compose BOM won’t move material3 to a beta, so you need to pin it.
1. Pin the version
Section titled “1. Pin the version”[versions]material3 = "1.5.0-beta02"
[libraries]androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3" }2. Switch the theme
Section titled “2. Switch the theme”@Composablefun AppTheme( darkTheme: Boolean = isSystemInDarkTheme(), dynamicColor: Boolean = true, content: @Composable () -> Unit,) { val context = LocalContext.current val colorScheme = when { dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) darkTheme -> darkColorScheme() else -> expressiveLightColorScheme() } MaterialExpressiveTheme( colorScheme = colorScheme, motionScheme = MotionScheme.expressive(), content = content, )}3. Use an Expressive component
Section titled “3. Use an Expressive component”@Composablefun FollowButton() { var following by rememberSaveable { mutableStateOf(false) } // Checked state changes both color and shape (round when off, square when on). ToggleButton(checked = following, onCheckedChange = { following = it }) { Text(if (following) "Following" else "Follow") }}Common mistakes
Section titled “Common mistakes”- Adding
@OptIn(ExperimentalMaterial3ExpressiveApi::class)everywhere. In beta02 onlyLoadingIndicator,MaterialShapesand a few helpers need it. Full list. - Keeping
tween()animations in custom UI. Use MotionScheme springs. - Using a deprecated API like
ListItem(headlineContent = …). What changed.
Want your agent to get this right every time? Install the skill. If this page helped,star the repo on GitHub.
Built by Sanikant. Set in Google Sans Flex (SIL Open Font License), icons from Material Symbols (Apache 2.0). Material Design is a Google trademark; this project is not affiliated with Google.