🌈 Create new beautiful Compose Gradients with our new wesite ->
Composable Function

BasicText

Displays text with semantics and accessibility information.

TextAutoSizeBasicTextSample

/** Sample of using [TextAutoSize.StepBased] to auto-size text. */
@Sampled
@Composable
fun TextAutoSizeBasicTextSample() {
    Box(modifier = Modifier.size(200.dp)) {
        // The text will find the biggest available font size that fits in the box.
        BasicText(text = "Hello World", autoSize = TextAutoSize.StepBased())
    }
}

/**
 * Example of a custom [TextAutoSize] implementation that uses a list of [TextUnit] presets to find
 * the fitting font size.
 */