TextLink
Component that displays an underlined text link
The default style uses the LocalTextStyle provided by the MaterialTheme / components. If you are setting your own style, you may want to consider first retrieving LocalTextStyle, and using TextStyle.copy to keep any theme defined attributes, only modifying the specific attributes you want to override.
For ease of use, commonly used parameters from TextStyle are also present here. The order of precedence is as follows:
If a parameter is explicitly set here (i.e, it is not
null
or TextUnit.Unspecified), then this parameter will always be used.If a parameter is not set, (
null
or TextUnit.Unspecified), then the corresponding value from style will be used instead.
Parameters
the text to be displayed that has link, should be provided as AnnotatedStringResource, with colors & underlined link parts We support Spark color intents & Typography to be added within annotations
label to be used for accessibility screen readers
the Modifier to be applied to this layout node
how visual overflow should be handled.
callback that is executed when a new text layout is calculated. A TextLayoutResult object that callback provides contains paragraph information, size of the text, baselines and other details. The callback can be used to add additional decoration or functionality to the text. For example, to draw selection around the text.
style configuration for the text such as color, font, line height etc.
callback when textLink container is clicked.