Label

@Composable
fun Label(text: String, modifier: Modifier = Modifier, ellipsize: EllipsizeMode = EllipsizeMode.NONE, justify: Justification = Justification.LEFT, lines: Int = -1, maxWidthChars: Int = -1, naturalWrapMode: NaturalWrapMode = NaturalWrapMode.INHERIT, selectable: Boolean = false, singleLineMode: Boolean = false, useMarkup: Boolean = false, useUnderline: Boolean = false, widthChars: Int = -1, wrap: Boolean = false, wrapMode: WrapMode = WrapMode.WORD, xAlign: Float = 0.5f, yAlign: Float = 0.5f, onActivateCurrentLink: () -> Unit? = null, onActivateLink: (uri: String) -> Boolean? = null, onCopyClipboard: () -> Unit? = null)

Creates a org.gnome.gtk.Label that displays text.

Parameters

text

The displayed text.

modifier

Compose Modifier for layout and styling.

ellipsize

The mode used to ellipsize the text if it does not have enough space.

justify

The alignment of the lines in the text.

lines

The number of lines to which an ellipsized, wrapping label should display before it gets ellipsized.

maxWidthChars

The desired maximum width of the label, in characters.

naturalWrapMode

Selects the line wrapping for the natural size request.

selectable

Whether the text can be selected.

singleLineMode

Whether the label is in single line mode.

useMarkup

Whether the text uses Pango markup.

useUnderline

Whether to use an underscore in the label for mnemonic activation.

widthChars

The desired width of the label, in characters.

wrap

Whether the text wraps if it's too long.

wrapMode

The mode used to wrap the text.

xAlign

The horizontal alignment of the text.

yAlign

The vertical alignment of the text.

onActivateCurrentLink

Callback triggered when a link inside the text is activated using keyboard navigation or accessibility tools.

onActivateLink

Callback triggered when the link is activated. Return true to handle the event manually.

onCopyClipboard

Callback triggered when the text is copied.