Skip to content

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.

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.

gradle/libs.versions.toml
[versions]
material3 = "1.5.0-beta02"
[libraries]
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3" }
@Composable
fun 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,
)
}
@Composable
fun 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")
}
}
  • Adding @OptIn(ExperimentalMaterial3ExpressiveApi::class) everywhere. In beta02 only LoadingIndicator, MaterialShapes and 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.