Components / Avatar

Avatar

Round avatar with initials colored from the name.

Example

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

Code

use ravenrs::prelude::*;

fn avatar() -> impl View {
    HStack::new((
        Avatar::new("Ana Lima"),
        Avatar::new("Bruno Reis").border(2.0, Semantic::Accent),
        Avatar::new("Carla Dias").size(44.0).image(Image::new(picture(1.0))),
    ))
    .spacing(8.0)
    .align(Align::Center)
}

Open in the playground, with every example →

Full API of Avatar →