Empty

@Stable
val Empty: TextStyle

It is needed to indicate that this style is empty and the rest of the styles need to be reset.

In the example below, we will get 789456 in the console, where 789 will be without any style, and 456 will be in bold, as indicated in the first Text. The second Text with the content change to 789 will also reset the previously specified style.

Box {
Text("123456", textStyle = TextStyle.Bold)
Text("789", textStyle = TextStyle.Empty)
}

Output to the console: 789456

When adding other styles to this, when using the plus operator, the added styles will be applied.

If you do not need to change the style specified earlier in any way, you can use TextStyle.Unspecified.

See also