Avatar
Avatar represents a person, team, or account with an image and a reliable text fallback.
Purpose
Avatar represents a person, team, or account with an image and a reliable text fallback.
Image and fallback
Installation
With the Siteplane registry alias configured, add the component and import the installed source from your app.
CLI
pnpm dlx shadcn@4.16.1 add @siteplane/avatarImport
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";Need the machine-readable source metadata? View registry JSON.
Usage
Avatar represents a person or workspace. Always provide a fallback for missing images.
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
export function Example() {
return (
<Avatar>
<AvatarImage src="/examples/avatar-maya.svg" alt="Maya Chen" />
<AvatarFallback>MC</AvatarFallback>
</Avatar>
);
}Examples
Sizes, radius, grouping and user rows are className compositions of the same three slots.
Sizes
Avatar has no size prop. Scale the root with className; image and fallback fill it.
Radius
Radius is a className on the root and the fallback, not a prop.
Avatar group
With user info
API Reference
The reference lists the source-owned exports and props that are easy to miss in visual examples. Inherited Base UI props remain available unless the wrapper narrows them.
AvatarImagerenders the image andAvatarFallbackrenders initials or another short fallback.- The root defaults to a 32px circular avatar. Change size or radius with existing system classes on
Avatar; do not create a parallel size API. - Keep
data-slot="avatar",avatar-image, andavatar-fallbackintact.
Motion
Component motion uses the shared Siteplane motion contract. See the global motion guide for provider setup, tokens and reduced-motion behavior.
- Avatar has no local animation. Image and fallback switching remains native to Base UI.
- Avatar groups are static layout compositions and must not add ad-hoc scale or hover motion.
Accessibility
- Give
AvatarImagemeaningful alt text when the image conveys information. Use empty alt text when a nearby label already names the person. - Keep fallback text short and understandable.
- Provide text outside a visual avatar group that names or summarizes its members.
- Never communicate identity, role, or status through the image alone.
Implementation Guidance
- Use Avatar only for people, teams, or account identity.
- Do not create wrapper primitives or local size and radius APIs.
- Preserve the image, fallback, and slot contract.