Label

Label shows read-only text on its own row - an explanation, a heading or a value - and wraps long text onto several lines.

Last updated

On this page

Read-only text on its own row: an explanation, a heading, or a value to show. Long text wraps onto several lines.

Label.builder("info")
        .text(() -> Text.translatable("mymod.info", "%s profiles saved", profiles.size()))
        .build();

Builder#

Method Required Default Notes
text(Supplier<Text>) / text(Text) yes re-read on every refresh
enabled, tooltip, visible no options every widget has

Behaviour#

Test it#

Rendered as [label info] 3 profiles saved.

See also#