MaterialTheme | API reference | Android Developers (original) (raw)
- Cmn
object MaterialTheme
Contains functions to access the current theme values provided at the call site's position in the hierarchy.
Summary
| Nested types |
|---|
| class MaterialTheme.Values Material 3 contains different theme subsystems to allow visual customization across a UI hierarchy. |
Public properties
colorScheme
val colorScheme: ColorScheme
Retrieves the current [ColorScheme](/reference/kotlin/androidx/compose/material3/ColorScheme) at the call site's position in the hierarchy.
import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.aspectRatio import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material3.MaterialTheme import androidx.compose.ui.Modifier import androidx.compose.ui.unit.sp
val colorScheme = MaterialTheme.colorScheme Box(Modifier.aspectRatio(1f).fillMaxSize().background(color = colorScheme.primary))
shapes
Retrieves the current [Shapes](/reference/kotlin/androidx/compose/material3/Shapes) at the call site's position in the hierarchy.
import androidx.compose.material3.Button import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text
val shape = MaterialTheme.shapes Button(shape = shape.small, onClick = {}) { Text("FAB with ${shape.small} shape") }
typography
val typography: Typography
Retrieves the current [Typography](/reference/kotlin/androidx/compose/material3/Typography) at the call site's position in the hierarchy.
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text
val typography = MaterialTheme.typography Text(text = "Headline small styled text", style = typography.headlineSmall)
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-04-08 UTC.