Avatar
Displays a user's profile image or initials
Usage
Show a user's profile picture with a graceful fallback when no image is available or it fails to load.
Sizes
Control the avatar size with the size prop.
Shapes
Change the avatar shape by applying a specific borderRadius value or using style props.
Variants
Switch the avatar’s visual style using the variant prop.
Colors
Customize the avatar’s background and text colors using colorPalette.
Ring
Add an outline ring around the avatar using the outline style props.
With badge
Add a status or notification badge to the avatar using Badge.
API Reference
AvatarRoot
The root component for the avatar.
| Prop | Type | Default |
|---|---|---|
| size | 2xs | xs | sm | md | lg | xl | 2xl | md |
| variant | primary | secondary | tetriary | ghost | surface | primary |
| asChild | boolean | false |
AvatarImage
The image component for the avatar.
| Prop | Type | Default |
|---|---|---|
| src | string | undefined |
| alt | string | undefined |
| asChild | boolean | false |
AvatarFallback
Show the fallback content when the avatar image fails to load.
| Prop | Type | Default |
|---|---|---|
| children | ReactNode | undefined |
| asChild | boolean | false |

