Text

Composable Function

Android
@Composable
fun Text(
    text: String,
    modifier: GlanceModifier = GlanceModifier,
    style: TextStyle = defaultTextStyle,
    maxLines: Int = Int.MAX_VALUE,
)

Adds a text view to the glance view.

Parameters

textThe text to be displayed.
modifierGlanceModifier to apply to this layout node.
style`TextStyle`` configuration for the text such as color, font, text align etc.
maxLinesAn optional maximum number of lines for the text to span, wrapping if necessary. If the text exceeds the given number of lines, it will be truncated.