# MaterialTheme

Artifact: [androidx.compose.material3:material3](https://developer.android.com/jetpack/androidx/releases/compose-material3) [View Source](https://cs.android.com/search?q=file:androidx/compose/material3/MaterialTheme.kt+class:androidx.compose.material3.MaterialTheme) Common/AllAndroid/JVM
- 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 https://developer.android.com/reference/kotlin/androidx/compose/material3/MaterialTheme.Values` Material 3 contains different theme subsystems to allow visual customization across a UI hierarchy. |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionLocal<https://developer.android.com/reference/kotlin/androidx/compose/material3/MaterialTheme.Values>` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/MaterialTheme#LocalMaterialTheme()` `https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionLocal` providing `https://developer.android.com/reference/kotlin/androidx/compose/material3/MaterialTheme` subsystems throughout the hierarchy. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/ColorScheme` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/MaterialTheme#colorScheme()` Retrieves the current `https://developer.android.com/reference/kotlin/androidx/compose/material3/ColorScheme` at the call site's position in the hierarchy. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/MotionScheme` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/MaterialTheme#motionScheme()` Retrieves the current `https://developer.android.com/reference/kotlin/androidx/compose/material3/MotionScheme` at the call site's position in the hierarchy. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/Shapes` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/MaterialTheme#shapes()` Retrieves the current `https://developer.android.com/reference/kotlin/androidx/compose/material3/Shapes` at the call site's position in the hierarchy. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/material3/Typography` | `https://developer.android.com/reference/kotlin/androidx/compose/material3/MaterialTheme#typography()` Retrieves the current `https://developer.android.com/reference/kotlin/androidx/compose/material3/Typography` at the call site's position in the hierarchy. | Cmn |

## Public properties

### LocalMaterialTheme

Cmn

```
val LocalMaterialTheme: CompositionLocal<MaterialTheme.Values>
```

`https://developer.android.com/reference/kotlin/androidx/compose/runtime/CompositionLocal` providing `https://developer.android.com/reference/kotlin/androidx/compose/material3/MaterialTheme` subsystems throughout the hierarchy. You can use properties in the companion object to access specific subsystems, for example `https://developer.android.com/reference/kotlin/androidx/compose/material3/MaterialTheme#colorScheme()`. To provide a new value for this, use `https://developer.android.com/reference/kotlin/androidx/compose/material3/MaterialTheme`. This API is exposed to allow retrieving values from inside CompositionLocalConsumerModifierNode implementations - in most cases you should use `https://developer.android.com/reference/kotlin/androidx/compose/material3/MaterialTheme#colorScheme()` and other properties directly.

### colorScheme

Cmn

```
val colorScheme: ColorScheme
```

Retrieves the current `https://developer.android.com/reference/kotlin/androidx/compose/material3/ColorScheme` at the call site's position in the hierarchy.

```kotlin
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))
```

### motionScheme

Cmn

```
val motionScheme: MotionScheme
```

Retrieves the current `https://developer.android.com/reference/kotlin/androidx/compose/material3/MotionScheme` at the call site's position in the hierarchy.

### shapes

Cmn

```
val shapes: Shapes
```

Retrieves the current `https://developer.android.com/reference/kotlin/androidx/compose/material3/Shapes` at the call site's position in the hierarchy.

```kotlin
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

Cmn

```
val typography: Typography
```

Retrieves the current `https://developer.android.com/reference/kotlin/androidx/compose/material3/Typography` at the call site's position in the hierarchy.

```kotlin
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text

val typography = MaterialTheme.typography
Text(text = "Headline small styled text", style = typography.headlineSmall)
```