Skip to content

Component Label

MeowLynxSea edited this page Jun 13, 2026 · 6 revisions

Label

A styled text label. Supports muted / strong / mono variants, ellipsis truncation, and optional line-wrapping.

Import

use yororen_ui::headless::label::label;

Minimal example

use yororen_ui::headless::label::label;

label("email-label", "Email", cx)
    .strong(true)
    .render(cx)

Props

Method Purpose
muted(v) Render in a muted color.
strong(v) Render in a bold weight.
mono(v) Use the monospaced font.
ellipsis(v) Truncate with when the text overflows.
wrap() Allow the label to wrap onto multiple lines.
max_lines(n) Cap the number of lines when wrapping.
inherit_color(v) Inherit the parent text color (skip the renderer's default label color).

Notes

  • Factory takes (id, text, _cx). Text is required at construction.
  • No state entity.
  • .render(cx) returns Stateful<Div>.

See also

Text, Heading, Badge

Clone this wiki locally