iced::widget

Function text

pub fn text<'a, Theme, Renderer>(
    text: impl IntoFragment<'a>,
) -> Text<'a, Theme, Renderer>
where Theme: Catalog + 'a, Renderer: Renderer,
Expand description

Creates a new Text widget with the provided content.

ยงExample

use iced::widget::text;
use iced::color;

enum Message {
    // ...
}

fn view(state: &State) -> Element<'_, Message> {
    text("Hello, this is iced!")
        .size(20)
        .color(color!(0x0000ff))
        .into()
}