-
Notifications
You must be signed in to change notification settings - Fork 9
Component Label
MeowLynxSea edited this page Feb 12, 2026
·
6 revisions
Semantic text with common variants.
Label is the most common text primitive in Yororen UI.
It supports common “tones” like muted/strong as well as truncation.
use yororen_ui::component::label;
let view = label("Muted").muted(true);
let strong = label("Strong").strong(true);- Body text and secondary text in settings/list rows
- Muted helper text (with
.muted(true)) - Monospace labels (file paths, ids) with
.mono(true)
-
label("..."): constructor -
id(...): stable identity -
muted(bool): usetheme.content.secondary -
strong(bool): semibold -
inherit_color(bool): do not set a default color (use parent) -
mono(bool): use monospace font -
ellipsis(bool): single-line truncation -
wrap(): enable automatic text wrapping -
lines(usize): clamp to max lines -
preview_lines(usize): clamp a multi-paragraph preview to max lines and append⋯
- Color:
theme.content.primary - If
muted(true):theme.content.secondary - Strong: semibold
- Use
ellipsis(true)for single-line rows inVirtualList. - Use
lines(n)for multi-line secondary text that still needs clamping. - Use
preview_lines(n)for previews of long / multi-paragraph content that opens in a modal. - Use
wrap()for descriptions that need to wrap to multiple lines. Requires parent container withw_full().
use yororen_ui::component::label;
let single_line = label("A very long title").ellipsis(true);
let two_lines = label("A longer description that can wrap").lines(2);
let preview = label("Paragraph 1\n\nParagraph 2")
.whitespace_normal()
.preview_lines(3);use yororen_ui::component::label;
let wrapping_description = label("A long description that should wrap to multiple lines when it exceeds the container width")
.wrap();-
inherit_color(true)is useful when placing a label inside a button that already setstext_color.
Yororen UI v0.3.0 · repository · Apache-2.0 · This wiki documents Yororen UI v0.3.0.
This wiki documents Yororen UI v0.3.0 — the headless-core, swappable-renderer build.