<div align="center">
# 👦 Avatar
[](https://crates.io/crates/avatar)
[](https://crates.io/crates/avatar)

[](https://www.rust-lang.org/)
[](https://www.rust-lang.org)
[](https://github.com/opensass)
[](https://discord.gg/b5JbvHW5nv)

</div>
## 🎬 Demo
| Yew | [](https://avatar-rs.netlify.app) |
| Dioxus | [](https://avatar-dio.netlify.app) |
| Leptos | [](https://avatar-lep.netlify.app) |
## 📜 Intro
A highly customizable, accessible avatar component for WASM frameworks: Yew, Dioxus, and Leptos.
Supports image loading with automatic fallback content, multiple sizes, color themes, and full WCAG compliance.
## 🤔 Why Avatar?
1. **🎨 Fully Customizable**: Control every attribute, class, style, size, color, variant, ARIA labels and more.
1. **🖼️ Smart Image Loading**: Tracks `idle → loading → loaded/error` status with context. Fallback is shown until the image is ready.
1. **⏱ Delay Support**: Prevent flash-of-fallback on fast connections with `delay_ms`.
1. **♿ Accessible by Default**: `role="img"`, `aria-label`, `aria-hidden` wired up automatically.
1. **🧩 Framework Agnostic**: Same API semantics across Yew, Dioxus, and Leptos.
## Y Yew Usage
Refer to [our guide](https://github.com/opensass/avatar/blob/main/YEW.md) to integrate this component into your Yew app.
## 🧬 Dioxus Usage
Refer to [our guide](https://github.com/opensass/avatar/blob/main/DIOXUS.md) to integrate this component into your Dioxus app.
## 🌱 Leptos Usage
Refer to [our guide](https://github.com/opensass/avatar/blob/main/LEPTOS.md) to integrate this component into your Leptos app.
## 🤝 Contributions
Contributions are welcome! Whether it's bug fixes, feature requests, or examples, we would love your help to make Avatar better.
1. Fork the repository.
1. Create a new branch for your feature/bugfix.
1. Submit a pull request for review.
## 📜 License
Avatar is licensed under the [MIT License](https://github.com/opensass/avatar/blob/main/LICENSE). You are free to use, modify, and distribute this library in your projects.