# MaterialTheme

# MaterialTheme

Artifact: [androidx.compose.material:material](https://developer.android.com/jetpack/androidx/releases/compose-material)  
[View Source](https://cs.android.com/search?q=file:androidx/compose/material/MaterialTheme.kt+class:androidx.compose.material.MaterialTheme)  
Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)
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

|                                       ### Public properties                                       |
|---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----|
| [Colors](https://developer.android.com/reference/kotlin/androidx/compose/material/Colors)         | [colors](https://developer.android.com/reference/kotlin/androidx/compose/material/MaterialTheme#colors()) Retrieves the current [Colors](https://developer.android.com/reference/kotlin/androidx/compose/material/Colors) at the call site's position in the hierarchy.                 | Cmn |
| [Shapes](https://developer.android.com/reference/kotlin/androidx/compose/material/Shapes)         | [shapes](https://developer.android.com/reference/kotlin/androidx/compose/material/MaterialTheme#shapes()) Retrieves the current [Shapes](https://developer.android.com/reference/kotlin/androidx/compose/material/Shapes) at the call site's position in the hierarchy.                 | Cmn |
| [Typography](https://developer.android.com/reference/kotlin/androidx/compose/material/Typography) | [typography](https://developer.android.com/reference/kotlin/androidx/compose/material/MaterialTheme#typography()) Retrieves the current [Typography](https://developer.android.com/reference/kotlin/androidx/compose/material/Typography) at the call site's position in the hierarchy. | Cmn |

## Public properties

### colors

Cmn  
Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)  

```
val colors: Colors
```

Retrieves the current [Colors](https://developer.android.com/reference/kotlin/androidx/compose/material/Colors) 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.material.MaterialTheme
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.sp

val colors = MaterialTheme.colors
Box(Modifier.aspectRatio(1f).fillMaxSize().background(color = colors.primary))
```  

### shapes

Cmn  
Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)  

```
val shapes: Shapes
```

Retrieves the current [Shapes](https://developer.android.com/reference/kotlin/androidx/compose/material/Shapes) at the call site's position in the hierarchy.  

### typography

Cmn  
Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-material#1.0.0)  

```
val typography: Typography
```

Retrieves the current [Typography](https://developer.android.com/reference/kotlin/androidx/compose/material/Typography) at the call site's position in the hierarchy.  

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

val typography = MaterialTheme.typography
Text(text = "H4 styled text", style = typography.h4)
```