Function freya_components::NetworkImage

source ·
pub fn NetworkImage(props: NetworkImageProps) -> Element
Expand description

Image component that automatically fetches and caches remote (HTTP) images.

§Example

fn app() -> Element {
    rsx!(
        NetworkImage {
            theme: theme_with!(NetworkImageTheme {
                width: "100%".into(),
                height: "100%".into(),
            }),
            url: "https://raw.githubusercontent.com/marc2332/freya/refs/heads/main/examples/rust_logo.png".parse::<Url>().unwrap()
        }
    )
}

§Preview

NetworkImage Preview