Fusuma

Components / Basics

text_fmt

Text from format_args!, in the body size.

Try it

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

Live: Navigation, where text_fmt is usedOpen full size

Also on this pagenamedtoastmenugestures

Text from format_args!, in the body size.

It formats into the node's own buffer: no allocation, and the node keeps the last 64 bytes (250 with long-text).

Signature

pub fn text_fmt(args: fmt::Arguments<'_>) -> FmtText

Methods

  • .title() -> Self — As a heading.
  • .caption() -> Self — Small and muted.

Example

use fusuma::{column, text_fmt};
let steps = 8412;
let view = column((text_fmt(format_args!("{steps} steps")),));
let built = fusuma::doc::built::<(), _>(&view);
assert_eq!(built.texts(), ["8412 steps"]);

All components · Source