Fusuma

Components / Basics

text

Text in the body size.

Try it

This is the Elevation page of the gallery, running in your browser: text is on it, and it is the real widget. Press Run, then use it.

Live: Elevation, where text is usedOpen full size

Also on this pageelevatedspacer

Text in the body size.

The text is one line in the theme's body size; .title(), .caption() and .code() change its role.

Signature

pub const fn text(text: &str) -> Text<'_>

Methods

  • .title() -> Self — As a heading.
  • .caption() -> Self — Small and muted.
  • .code() -> Self — Fixed-width, for code.

Example

use fusuma::{column, text};
let view = column((text("Temperature"), text("21.5").title()));
let built = fusuma::doc::built::<(), _>(&view);
assert_eq!(built.texts(), ["Temperature", "21.5"]);

All components · Source