JengaText

fun JengaText(text: String, modifier: Modifier = Modifier, color: Color = Color.Unspecified, style: TextStyle = JengaTheme.typography.bodyMedium, textAlign: TextAlign? = null, overflow: TextOverflow = TextOverflow.Clip, softWrap: Boolean = true, maxLines: Int = Int.MAX_VALUE, minLines: Int = 1, maxFontScale: Float? = null)(source)

The canonical way to render text in Jenga.

Defaults to JengaTheme tokens: JengaTheme.typography.bodyMedium and JengaTheme.colors.textPrimary. Built on Compose Foundation's BasicText (no Material dependency), so its look is governed entirely by Jenga tokens.

Color resolution order: the explicit color param → the style's color → the inherited LocalJengaContentColor (e.g. set by a button) → the theme's JengaTheme.colors.textPrimary.

Parameters

text

the string to display.

modifier

the Modifier for this text.

color

text color; Color.Unspecified falls back to style then theme.

style

the TextStyle; defaults to body text from the theme.

textAlign

horizontal alignment of the text within its bounds.

overflow

how visual overflow is handled.

softWrap

whether text wraps at soft line breaks.

maxLines

maximum number of lines; excess is truncated per overflow.

minLines

minimum number of lines to occupy.

maxFontScale

optional cap on the system font scale for this text (e.g. 1.25f for display type). See io.github.joelkanyi.jenga.foundation.typography.JengaTypographyDefaults.

Samples

JengaText(
    text = "Scan a ticket to begin",
)

fun JengaText(text: AnnotatedString, modifier: Modifier = Modifier, color: Color = Color.Unspecified, style: TextStyle = JengaTheme.typography.bodyMedium, textAlign: TextAlign? = null, overflow: TextOverflow = TextOverflow.Clip, softWrap: Boolean = true, maxLines: Int = Int.MAX_VALUE, minLines: Int = 1, maxFontScale: Float? = null)(source)

AnnotatedString overload of JengaText for rich/multi-style text (links, partial emphasis). Same color-resolution and maxFontScale rules as the String overload.

Parameters

text

the styled text to display.

modifier

the Modifier for this text.

color

base text color; Color.Unspecified falls back to style then theme.

style

the TextStyle; defaults to body text from the theme.

textAlign

horizontal alignment of the text within its bounds.

overflow

how visual overflow is handled.

softWrap

whether text wraps at soft line breaks.

maxLines

maximum number of lines; excess is truncated per overflow.

minLines

minimum number of lines to occupy.

maxFontScale

optional cap on the system font scale for this text.