<span class="avatar">AB</span>
<span class="avatar primary">CD</span>
<span class="avatar success">EF</span>
Avatar
User profile image or initials. One root class — avatar — with semantic colour and size modifiers.
Default Avatar
Sizes
<span class="avatar small">SM</span>
<span class="avatar">MD</span>
<span class="avatar large">LG</span>
With Image
<span class="avatar large">
<img src="avatar.jpg" alt="Alice Smith">
</span>
Avatar Group
Stack avatars using negative margin on a flex row:
AB
CD
EF
+4
<div>
<span class="avatar primary">AB</span>
<span class="avatar success" >CD</span>
<span class="avatar" >+4</span>
</div>
Variants
| Class | Use |
|---|---|
avatar | Default neutral — initials or fallback |
avatar primary | Brand color background |
avatar success | Online / active state |
avatar secondary | Secondary color background |
avatar small | 32px — inline text, tables |
avatar large | 48px — profile headers |
Accessibility
- Initials-only avatars need
aria-labelon the element - Image avatars need meaningful
alttext on the<img> - Decorative avatars use
alt=""to hide from screen readers
Features
- Semantic Structure - Built with native HTML5 elements for maximum reliability.
- Theme Aware - Automatically adapts to all 22 Axiom01 themes via OKLCH tokens.
- Fully Responsive - Scales perfectly from mobile to desktop screens.
- No JS Dependency - Core functionality relies on pure CSS for maximum performance.
- Customizable - Easily extendable via Axiom01's design tokens and modifiers.
Use Cases
The Avatar component is designed for versatile implementation across modern web applications. Ideal scenarios include:
- Dashboards & Admin Panels - Structured data presentation and interface control.
- Content Management Systems - Organizing complex information hierarchies and media.
- E-Commerce Platforms - Enhancing product discovery and user workflows.
- Marketing Sites - Highlighting key product offerings cleanly and effectively.
- SaaS Applications - Delivering native-feeling, responsive app experiences.