Skip to main content

Text

Function Text 

Source
pub fn Text<S>(__arg0: S, __arg1: Modifier, __arg2: TextStyle) -> NodeId
where S: IntoTextSource + Clone + PartialEq + 'static,
Expand description

High-level element that displays text.

§When to use

Use this widget to display read-only text on the screen. For editable text, use BasicTextField.

§Arguments

  • value - The string to display. Can be a &str, String, or State<String>.
  • modifier - Modifiers to apply (e.g., padding, background, layout instructions).
  • style - Text styling (color, font size).

§Example

Text("Hello World", Modifier::padding(16.0), TextStyle::default());