androidx.compose.material3

ProvideTextStyle

Composable function

Smaller pieces that other components use, or that help build your own.

ProvideTextStyle

Sets the text style for all Text inside it.

Two texts that take the style from ProvideTextStyle
Two texts that take the style from ProvideTextStyle
ProvideTextStyle(MaterialTheme.typography.headlineSmall) {
    Column {
        Text("Both lines")
        Text("use headlineSmall")
    }
}

Scrim

A dim layer that covers content, for example behind your own popup.

A scrim over some content
A scrim over some content
Box(Modifier.size(240.dp, 120.dp)) {
    Text("Content under the scrim", Modifier.padding(16.dp))
    Scrim(contentDescription = "Close", onClick = { /* close what is on top */ }, alpha = { 0.6f })
}

VerticalDragHandle

A handle to drag, for example between two resizable panes.

A handle between two panesExpressive theme
A handle between two panes
Row(Modifier.size(320.dp, 140.dp), verticalAlignment = Alignment.CenterVertically) {
    Surface(Modifier.weight(1f).fillMaxHeight(), color = MaterialTheme.colorScheme.surfaceContainer, shape = MaterialTheme.shapes.large) {}
    VerticalDragHandle(Modifier.padding(horizontal = 8.dp))
    Surface(Modifier.weight(1f).fillMaxHeight(), color = MaterialTheme.colorScheme.surfaceContainer, shape = MaterialTheme.shapes.large) {}
}

Label

Shows a short label on hover or long press, like a tooltip without a box.

A label that is always shownExpressive theme
A label that is always shown
Box(Modifier.size(160.dp, 100.dp), contentAlignment = Alignment.BottomCenter) {
    Label(
        label = { PlainTooltip { Text("Favorite") } },
        // Always shown. Without it, the label shows on hover or long press.
        isPersistent = true,
    ) {
        Icon(Icons.Filled.Favorite, contentDescription = "Favorite")
    }
}

ScrollField

An Expressive wheel to pick a number by scrolling.

A scroll field to pick a minuteExpressive theme
A scroll field to pick a minute
val state = rememberScrollFieldState(itemCount = 60, index = 15)
ScrollField(state = state, modifier = Modifier.size(96.dp, 160.dp))

Parameters

@Composable
fun ProvideTextStyle(value: TextStyle, content: @Composable () -> Unit)

value: TextStyleRequired

The text style for Text inside, for example MaterialTheme.typography.titleMedium.

content: @Composable () -> UnitRequired

The content this helper applies to.

Helpers on this page