---
title: "rotate"
description: "Sets the degrees the view is rotated around the center of the composable. Increasing values
result in clockwise rotation. Negative degrees are used to rotate in the counter clockwise
direction

Usage of this API renders this composable into a separate graphics layer."
type: "modifier"
---

<div class='type'>Compose Modifier</div>

<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
fun Modifier.rotate(degrees: Float) =
    if (degrees != 0f) graphicsLayer(rotationZ = degrees) else this
```


Sets the degrees the view is rotated around the center of the composable. Increasing values
result in clockwise rotation. Negative degrees are used to rotate in the counter clockwise
direction

Usage of this API renders this composable into a separate graphics layer.



## Code Examples
### RotateSample
```kotlin
@Composable
fun RotateSample() {
    Box(Modifier.rotate(45f).size(100.dp, 100.dp))
}
```

