Avatar
A component for displaying user profile images with fallback initials or icons.View source →This component's API and documentation are under review and may change. Use with caution in production.
Avatar displays a user's profile image with graceful fallback to initials or an icon when the image fails to load. It supports multiple sizes, variants, and colors for various contexts.
This is an enhanced version of the Avatar from Radix Themes, built on Radix UI Avatar.
Playground
Installation
shellUsage
tsxProps
With Image
Display a user's profile image.
tsxFallback
When no image is provided or it fails to load, the fallback content is displayed.
tsxSizes
Avatars support 12 sizes from compact (1) to large (12).
tsxVariants
Control the fallback appearance with variants.
tsxColors
Use colors to differentiate users or roles.
tsxRadius
Customize the border radius.
tsxStatus
Add a status indicator dot to show presence or state.
tsxThe status indicator scales automatically with the avatar size.
tsxBadge
Use the badge prop for custom indicator content like icons or notification counts.
tsxNote: status and badge cannot be used together. If both are provided, badge takes precedence and a warning is logged in development.
Fit
Control how images are scaled within the avatar container. This is useful for logos or images that shouldn't be cropped.
tsxcover(default): Scales image to fill the container, may crop edgescontain: Scales image to fit entirely within container, may leave empty spacefill: Stretches image to fill container exactly, may distortscale-down: Like contain but never scales up beyond original sizenone: Image keeps original size
The fit prop also supports responsive values:
tsx