State of Compose 2023 results are in! Click here to learn more

← Back to Foundation

ProvideTextStyle

Component
in
Foundation
. Since 0.1.0-dev15

Overview

Code Examples

This function is used to set the current value of AmbientTextStyle, merging the given style with the current style values for any missing attributes. Any Text components included in this component's children will be styled with this style unless styled explicitly.

@see AmbientTextStyle

Overloads

ProvideTextStyle

@Suppress("ComposableLambdaParameterNaming")
@Deprecated(
    message = "ProvideTextStyle has moved to the Material library. For non-Material applications," +
        " create your own design system specific theming ambients.",
    replaceWith = ReplaceWith(
        "ProvideTextStyle(value, children)",
        "androidx.compose.material.ProvideTextStyle"
    )
)
@Composable
fun ProvideTextStyle(value: TextStyle, children: @Composable () -> Unit)