shadcn.io is not affiliated with official shadcn/ui
Avatar examples · Standard
Avatar Standard for React
A round avatar with a profile picture and initials as the fallback.
Every app with people in it needs avatars, the small round photos that put a face next to a name. This React avatar pairs an AvatarImage for the photo with an AvatarFallback holding initials, which take over when the image is missing or fails to load. Use it in profiles, comment threads, member lists, or anywhere a person needs a face.
Preview
Installation
FAQ
When do the initials show?
AvatarFallback sits next to AvatarImage and shows when the image is missing or fails to load. This file puts the letters CN there. The muted background comes from the avatar styles.
What alt text should the photo use?
AvatarImage takes alt. Use the person's name. When that name is already written next to the avatar, an empty alt keeps it from being read twice.
How big is this avatar, and how do I change it?
size is left at the default, and the image sets width and height to 32 so the photo matches the circle. size also accepts sm and lg, and the fallback text scales with it.
Where does the round shape come from?
The avatar styles set rounded-full on Avatar, the image, the fallback, and the hairline after: border. This file doesn't pass a radius.
Related
- Avatar with Placeholder Initials (Standard)A round avatar with no picture that shows
- Avatar with Placeholder Icon (Standard)A round avatar with no picture that shows
- Avatar with Online Indicator (Standard)A round avatar with a green dot at the
- Avatar SquareA square avatar with a profile picture
- Avatar with Count Indicator (Standard)A round avatar with a red count of unread
- Avatar with Offline Indicator (Standard)A round avatar with a gray dot at the