Avatar

An image element with a fallback for representing the user.

Installation

The CLI is not yet available. For now, manually copy the component source into your project.

rust-shadcn-ui add avatar

Usage

use yew::prelude::*;

use crate::components::ui::avatar::{Avatar, AvatarFallback, AvatarImage};

#[component]
fn Usage() -> impl IntoView {
    view! {
        <Avatar>
            <AvatarImage src="https://github.com/shadcn.png" />
            <AvatarFallback>{"CN"}</AvatarFallback>
        </Avatar>
    }
}

See Also