An avatar is a visual representation of a user or entity. It helps personalize interactions, making user interfaces more engaging and recognizable. Avatars can display initials, images, or both, ensuring identification even when an image is unavailable.
Avatars are commonly used in:
When an avatar image is unavailable or not specified, initials are displayed as a fallback.
<span class="avatar">
<span class="avatar__initials">AS</span>
</span>
Best for: Ensuring a user or entity is still represented even if no image is available.
When a profile image is provided, it is displayed above the initials, ensuring a consistent backup in case of image loading errors.
<span class="avatar">
<span class="avatar__initials">AS</span>
<span class="avatar__img">
<img src="images/avatar.png">
</span>
</span>
Best for: User profiles, personalized dashboards, and team collaborations.
Small avatars are ideal for compact spaces like:
<span class="avatar avatar--s">...</span>
Large avatars are prominent and visually distinct, often used for:
<span class="avatar avatar--l">...</span>
Using avatars helps create a recognizable and user-friendly experience across all interfaces. Try implementing different sizes and sources to best fit your design needs!