androidx.compose.material3

MaterialExpressiveThemeSince 1.10

Composable function

One of the theme types. It works like MaterialTheme. Only the parameters that differ are described here.

The theme for Expressive apps. Values you leave out use the Expressive defaults, including the springy motion.

The Expressive theme with its default values
The Expressive theme with its default values
// Values left out (colors, shapes, ...) use the Expressive defaults.
MaterialExpressiveTheme {
    Surface {
        Row(Modifier.padding(16.dp), horizontalArrangement = Arrangement.spacedBy(8.dp)) {
            Button(onClick = {}, shapes = ButtonDefaults.shapes()) { Text("Save") }
            ContainedLoadingIndicator(Modifier.size(40.dp))
        }
    }
}

Parameters

@Composable
fun MaterialExpressiveTheme(
    colorScheme: ColorScheme? = null,
    motionScheme: MotionScheme? = null,
    shapes: Shapes? = null,
    typography: Typography? = null,
    content: @Composable () -> Unit,
)

colorScheme: ColorScheme?Optional

Default: null

All colors of the theme. Use lightColorScheme(...) or darkColorScheme(...), and pass only the colors you want to change. Pick between them with isSystemInDarkTheme(). See the Colors guide.

motionScheme: MotionScheme?Optional

Default: null

How animations feel. MotionScheme.standard() is calm. MotionScheme.expressive() is bouncier.

shapes: Shapes?Optional

Default: null

The corner sizes of the theme. See the Shapes guide.

typography: Typography?Optional

Default: null

All text styles of the theme. Create one with Typography(...) and pass only the styles you want to change. See the Typography guide.

Same as in MaterialTheme: content.

Theme types