New Compose Multiplatform components arrived on Composables UICheck it out →

Modifier in Compose Ui

rotate

Common

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

Last updated:

Installation

dependencies {
   implementation("androidx.compose.ui:ui:1.7.0-beta04")
}

Overloads

@Stable
fun Modifier.rotate(degrees: Float)

Code Example

RotateSample

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