Function text

Source
pub fn text(args: impl Into<TextArgs>)
Expand description

Basic text component.

ยงExample

use tessera_ui_basic_components::text::{text, TextArgs, TextArgsBuilder};
use tessera_ui::Dp;
// a simple hello world text, in black
let args = TextArgsBuilder::default()
    .text("Hello, World!".to_string())
    .size(Dp(50.0)) // Example using Dp
    // line_height will be Dp(60.0) (1.2 * size) by default
    .build()
    .unwrap();
text(args);