Avatar
Image with automatic fallback.
Installation
Usage
Examples
Sizes
Control the size with height and width utilities. Default is h-10 w-10.
Square shape
Override the default full rounding with any radius. Apply it to both Avatar and AvatarFallback.
Stacked group
Overlap avatars with negative spacing, matching the ring to the card behind them.
API reference
Avatar
| Prop | Type | Default |
|---|---|---|
renderPolymorphic render prop. Use to render a custom element instead of the default span. | ReactElement | ((props) => ReactNode) | - |
classNameAdditional classes merged with the default avatar styles. Use h-*/w-* to resize. | string | - |
AvatarImage
| Prop | Type | Default |
|---|---|---|
srcImage URL rendered in a native img element. | string | - |
altAccessible text for the image. | string | - |
onLoadingStatusChangeCalled when the image loading status changes. | (status: 'idle' | 'loading' | 'loaded' | 'error') => void | - |
renderPolymorphic render prop. Use to render a custom element instead of the default img. | ReactElement | ((props) => ReactNode) | - |
classNameAdditional classes merged with the default image styles. | string | - |
AvatarFallback
| Prop | Type | Default |
|---|---|---|
delayMilliseconds to wait before showing the fallback. | number | - |
renderPolymorphic render prop. Use to render a custom element instead of the default span. | ReactElement | ((props) => ReactNode) | - |
classNameAdditional classes merged with the default fallback styles. | string | - |