text

open fun text(content: String): ComponentBuilder

Appends a text component with the specified string content.

Return

this component builder for chaining

Parameters

content

the string content to append


open fun text(content: String, consumer: Styler.() -> Unit): ComponentBuilder

Appends a text component with the specified string content and applies additional configuration. This method combines appending text with a nested component builder scope, allowing you to build complex component hierarchies in a fluent way.

Return

this component builder for chaining

Parameters

content

the string content to append

consumer

the consumer lambda that operates on a component builder to configure the appended text


abstract fun text(content: String, regex: Regex, styler: Styler.() -> Unit): ComponentBuilder

Appends text and styles parts of it that match the given regular expression.

Return

this component builder for chaining

Parameters

content

the full text content

regex

the regular expression to match against the content

styler

the styler to apply to the matching parts


open fun text(content: String, vararg formatters: TextColor): ComponentBuilder

Appends a text component with multiple text colors applied sequentially. Each color in the formatters array is applied to the component's style.

Return

this component builder for chaining

Parameters

content

the string content to append

formatters

variable number of text colors to apply to the component