Compose Modifier

scale

Scale the contents of the composable by the following scale factors along the horizontal and vertical axis respectively.

ScaleNonUniformSample

@Sampled
@Composable
fun ScaleNonUniformSample() {
    Box(Modifier.scale(scaleX = 2f, scaleY = 3f).size(100.dp, 100.dp))
}

ScaleUniformSample

@Sampled
@Composable
fun ScaleUniformSample() {
    Box(Modifier.scale(2f).size(100.dp, 100.dp))
}
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: