MA
Avatar Component
An image element with a fallback for representing the user.
- Displays user images with elegant fallback options
- Supports different sizes
- Offers customizable shapes (rounded, square)
Installation
The Avatar component is part of our UI library. You can import it directly from the components directory.
Usage
Here is how to use the avatar in your project.
React TSX
React TSX
Examples
Basic Avatar
MA
Avatar with Fallback
JD
Avatar Sizes
MAMAMA
API Reference
Avatar
Prop | Type | Default | Description |
---|---|---|---|
className | string | - | Additional CSS classes |
children | ReactNode | - | AvatarImage and AvatarFallback components |
AvatarImage
Prop | Type | Default | Description |
---|---|---|---|
src | string | - | URL of the avatar image |
alt | string | - | Alt text for the avatar image |
className | string | - | Additional CSS classes |
AvatarFallback
Prop | Type | Default | Description |
---|---|---|---|
delayMs | number | 600 | Delay before showing fallback when image fails to load |
className | string | - | Additional CSS classes |
children | ReactNode | - | Content to display as fallback |
AvatarGroup
Prop | Type | Default | Description |
---|---|---|---|
className | string | - | Additional CSS classes |
children | ReactNode | - | Avatar components |
max | number | - | Maximum number of avatars to display before showing a count |