Data Display
Avatar
A circular container for user profile images with automatic fallback support. Shows initials or placeholder content when the image is unavailable.
With Image
CN
Import
import {
Avatar,
AvatarFallback,
AvatarImage,
} from "@mikenotthepope/substrateui"Composition
Avatar
├── AvatarImage
└── AvatarFallbackFallback Initials
JDAB
Custom Sizes
SMMDLGXL
API Reference
Avatar
| Prop | Type | Default | Description |
|---|---|---|---|
className | string | — | Additional CSS classes. Use to override the default h-10 w-10 sizing. |
AvatarImage
| Prop | Type | Default | Description |
|---|---|---|---|
srcrequired | string | — | The image URL for the avatar. |
altrequired | string | — | Accessible alt text for the avatar image. |
className | string | — | Additional CSS classes for the image element. |
AvatarFallback
| Prop | Type | Default | Description |
|---|---|---|---|
childrenrequired | React.ReactNode | — | Fallback content shown while the image loads or when it fails. Typically initials. |
className | string | — | Additional CSS classes for the fallback container. |