We just launched Compose Examples featuring over 150+ components! Check it out →

rotate

Common

Modifier in Compose Ui

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.

Last updated:

Installation

dependencies {
   implementation("androidx.compose.ui:ui:1.8.0-alpha01")
}

Overloads

@Stable
fun Modifier.rotate(degrees: Float)

Code Example

RotateSample

@Composable
fun RotateSample() {
    Box(Modifier.rotate(45f).size(100.dp, 100.dp))
}
by @alexstyl