Skip to content

Component Text

MeowLynxSea edited this page Jun 13, 2026 · 4 revisions

Text

A body text run. The simplest typographic component.

Import

use yororen_ui::headless::text::text;

Minimal example

use yororen_ui::headless::text::text;

text("body", "Hello, world.", cx)
    .size(px(14.0))
    .render(cx)

Props

Method Purpose
size(px) Render size in pixels.

The factory takes (id, text, _cx). The text content is set at construction.

Notes

  • text is also the name of the function and its second argument. The module path is yororen_ui::headless::text::text (factory) and yororen_ui::headless::text::TextProps (struct).
  • No state entity.
  • .render(cx) returns Stateful<Div>.

See also

Label, Heading, EmptyState

Clone this wiki locally