SpanText

@Composable
fun SpanText(text: String, modifier: Modifier = Modifier, variant: CssStyleVariant<SpanTextKind>? = null, ref: ElementRefScope<HTMLSpanElement>? = null)(source)

A span of text, which can be styled based on a passed-in Modifier.

Essentially a convenient shortcut for

Span(attrs = modifier.toAttrs()) {
Text("Some text")
}

This class is useful for creating an umbrella span on top of a bunch of text that you additionally want to apply some Modifier styles to. It may also be useful if you want to ensure that a leading or trailing space doesn't get swallowed, which Text suffers from in some cases (e.g. within a parent container that uses a flex display).

Note it is perfectly fine (and expected) for callers to reach to the Text method that comes from Compose HTML in most cases.