TextLink

fun TextLink(@StringRes text: Int, modifier: Modifier = Modifier, enabled: Boolean = true, shape: Shape = ButtonDefaults.textShape, colors: ButtonColors = ButtonDefaults.textButtonColors(), elevation: ButtonElevation? = null, border: BorderStroke? = null, contentPadding: PaddingValues = ButtonDefaults.TextButtonContentPadding, fontSize: TextUnit = TextUnit.Unspecified, fontStyle: FontStyle? = null, fontWeight: FontWeight? = null, fontFamily: FontFamily? = null, letterSpacing: TextUnit = TextUnit.Unspecified, textDecoration: TextDecoration? = null, textAlign: TextAlign? = null, lineHeight: TextUnit = TextUnit.Unspecified, overflow: TextOverflow = TextOverflow.Clip, softWrap: Boolean = true, maxLines: Int = Int.MAX_VALUE, onTextLayout: (TextLayoutResult) -> Unit = {}, style: TextStyle = LocalTextStyle.current, onClick: () -> Unit)

Parameters

text

Int ID of the StringRes to be displayed

modifier

the Modifier to be applied to this layout node

enabled

controls the enabled state of this button. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.

shape

defines the shape of this button's container, border (when border is not null), and shadow (when using elevation)

colors

ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.textButtonColors.

elevation

ButtonElevation used to resolve the elevation for this button in different states. This controls the size of the shadow below the button. Additionally, when the container color is ColorScheme.surface, this controls the amount of primary color applied as an overlay. A TextButton typically has no elevation, and the default value is null. See ElevatedButton for a button with elevation.

border

the border to draw around the container of this button

contentPadding

the spacing values to apply internally between the container and the content

If Color.Unspecified, and style has no color set, this will be LocalContentColor

fontSize

the size of glyphs to use when painting the text. See TextStyle.fontSize

fontStyle

the typeface variant to use when drawing the letters (e.g., italic) See TextStyle.fontStyle

fontWeight

the typeface thickness to use when painting the text (e.g., FontWeight.Bold)

fontFamily

the font family to be used when rendering the text. See TextStyle.fontFamily

letterSpacing

the amount of space to add between each letter. See TextStyle.letterSpacing

textDecoration

the decorations to paint on the text (e.g., an underline). See TextStyle.textDecoration

textAlign

the alignment of the text within the lines of the paragraph. See TextStyle.textAlign

lineHeight

line height in TextUnit unit, e.g. SP or EM. See TextStyle.lineHeight

overflow

how visual overflow should be handled.

softWrap

whether the text should break at soft line breaks

If false, the glyphs in the text will be positioned as if there was unlimited horizontal space. If softWrap is false, overflow and TextAlign may have unexpected effects

maxLines

an 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 according to overflow and softWrap

If it is not null, then it must be greater than zero

onTextLayout

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.

style

style configuration for the text such as color, font, line height etc.

onClick

action when user click text


fun TextLink(text: String, modifier: Modifier = Modifier, enabled: Boolean = true, shape: Shape = ButtonDefaults.textShape, colors: ButtonColors = ButtonDefaults.textButtonColors(), elevation: ButtonElevation? = null, border: BorderStroke? = null, contentPadding: PaddingValues = ButtonDefaults.TextButtonContentPadding, fontSize: TextUnit = TextUnit.Unspecified, fontStyle: FontStyle? = null, fontWeight: FontWeight? = null, fontFamily: FontFamily? = null, letterSpacing: TextUnit = TextUnit.Unspecified, textDecoration: TextDecoration? = null, textAlign: TextAlign? = null, lineHeight: TextUnit = TextUnit.Unspecified, overflow: TextOverflow = TextOverflow.Clip, softWrap: Boolean = true, maxLines: Int = Int.MAX_VALUE, minLines: Int = 1, onTextLayout: (TextLayoutResult) -> Unit = {}, style: TextStyle = LocalTextStyle.current, onClick: () -> Unit)

Parameters

text

String to be displayed

modifier

the Modifier to be applied to this layout node

enabled

controls the enabled state of this button. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.

shape

defines the shape of this button's container, border (when border is not null), and shadow (when using elevation)

colors

ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.textButtonColors.

elevation

ButtonElevation used to resolve the elevation for this button in different states. This controls the size of the shadow below the button. Additionally, when the container color is ColorScheme.surface, this controls the amount of primary color applied as an overlay. A TextButton typically has no elevation, and the default value is null. See ElevatedButton for a button with elevation.

border

the border to draw around the container of this button

contentPadding

the spacing values to apply internally between the container and the content

If Color.Unspecified, and style has no color set, this will be LocalContentColor

fontSize

the size of glyphs to use when painting the text. See TextStyle.fontSize

fontStyle

the typeface variant to use when drawing the letters (e.g., italic) See TextStyle.fontStyle

fontWeight

the typeface thickness to use when painting the text (e.g., FontWeight.Bold)

fontFamily

the font family to be used when rendering the text. See TextStyle.fontFamily

letterSpacing

the amount of space to add between each letter. See TextStyle.letterSpacing

textDecoration

the decorations to paint on the text (e.g., an underline). See TextStyle.textDecoration

textAlign

the alignment of the text within the lines of the paragraph. See TextStyle.textAlign

lineHeight

line height in TextUnit unit, e.g. SP or EM. See TextStyle.lineHeight

overflow

how visual overflow should be handled.

softWrap

whether the text should break at soft line breaks

If false, the glyphs in the text will be positioned as if there was unlimited horizontal space. If softWrap is false, overflow and TextAlign may have unexpected effects

maxLines

an 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 according to overflow and softWrap

If it is not null, then it must be greater than zero

onTextLayout

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.

style

style configuration for the text such as color, font, line height etc.

onClick

action when user click text


fun TextLink(text: AnnotatedString, modifier: Modifier = Modifier, enabled: Boolean = true, shape: Shape = ButtonDefaults.textShape, colors: ButtonColors = ButtonDefaults.textButtonColors(), elevation: ButtonElevation? = null, border: BorderStroke? = null, contentPadding: PaddingValues = ButtonDefaults.TextButtonContentPadding, fontSize: TextUnit = TextUnit.Unspecified, fontStyle: FontStyle? = null, fontWeight: FontWeight? = null, fontFamily: FontFamily? = null, letterSpacing: TextUnit = TextUnit.Unspecified, textDecoration: TextDecoration? = null, textAlign: TextAlign? = null, lineHeight: TextUnit = TextUnit.Unspecified, overflow: TextOverflow = TextOverflow.Clip, softWrap: Boolean = true, maxLines: Int = Int.MAX_VALUE, minLines: Int = 1, onTextLayout: (TextLayoutResult) -> Unit = {}, style: TextStyle = LocalTextStyle.current, onClick: () -> Unit)

Parameters

text

AnnotatedString to be displayed

modifier

the Modifier to be applied to this layout node

enabled

controls the enabled state of this button. When false, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.

shape

defines the shape of this button's container, border (when border is not null), and shadow (when using elevation)

colors

ButtonColors that will be used to resolve the colors for this button in different states. See ButtonDefaults.textButtonColors.

elevation

ButtonElevation used to resolve the elevation for this button in different states. This controls the size of the shadow below the button. Additionally, when the container color is ColorScheme.surface, this controls the amount of primary color applied as an overlay. A TextButton typically has no elevation, and the default value is null. See ElevatedButton for a button with elevation.

border

the border to draw around the container of this button

contentPadding

the spacing values to apply internally between the container and the content

If Color.Unspecified, and style has no color set, this will be LocalContentColor

fontSize

the size of glyphs to use when painting the text. See TextStyle.fontSize

fontStyle

the typeface variant to use when drawing the letters (e.g., italic) See TextStyle.fontStyle

fontWeight

the typeface thickness to use when painting the text (e.g., FontWeight.Bold)

fontFamily

the font family to be used when rendering the text. See TextStyle.fontFamily

letterSpacing

the amount of space to add between each letter. See TextStyle.letterSpacing

textDecoration

the decorations to paint on the text (e.g., an underline). See TextStyle.textDecoration

textAlign

the alignment of the text within the lines of the paragraph. See TextStyle.textAlign

lineHeight

line height in TextUnit unit, e.g. SP or EM. See TextStyle.lineHeight

overflow

how visual overflow should be handled.

softWrap

whether the text should break at soft line breaks

If false, the glyphs in the text will be positioned as if there was unlimited horizontal space. If softWrap is false, overflow and TextAlign may have unexpected effects

maxLines

an 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 according to overflow and softWrap

If it is not null, then it must be greater than zero

onTextLayout

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.

style

style configuration for the text such as color, font, line height etc.

onClick

action when user click text