Components / Image

Image

Shows an image, with fit modes.

Example

The component itself, running in WebAssembly, beside its code in a playground. Try it.

Code

use ravenrs::prelude::*;

fn image() -> impl View {
    HStack::new((
        // `.crossfade` dissolves into the next image the app hands it.
        Image::new(picture(1.0)).size(160.0, 90.0).corner_radius(12.0).crossfade(0.2),
        Image::new(picture(0.3)).size(90.0, 90.0).corner_radius(45.0),
    ))
    .spacing(12.0)
}

Open in the playground, with every example →

Full API of Image →