Avatars with fallbacks, status badges, and grouped stacks.
npx shadcn@latest add @iconiq/avatarimport {
Avatar,
AvatarBadge,
AvatarFallback,
AvatarGroup,
AvatarImage,
} from "@/components/ui/avatar";
export function AvatarDemo() {
return (
<div className="flex items-center gap-10">
<Avatar size="lg" tooltip="online">
<AvatarImage src="/assets/shadcn.jpg" alt="shadcn/ui" />
<AvatarFallback>SU</AvatarFallback>
<AvatarBadge />
</Avatar>
<AvatarGroup>
<Avatar size="lg">
<AvatarImage src="/assets/av1.png" alt="Avatar 1" />
<AvatarFallback>A1</AvatarFallback>
</Avatar>
<Avatar size="lg">
<AvatarImage src="/assets/av3.png" alt="Avatar 3" />
<AvatarFallback>A3</AvatarFallback>
</Avatar>
<Avatar size="lg">
<AvatarImage src="/assets/av2.png" alt="Avatar 2" />
<AvatarFallback>A2</AvatarFallback>
</Avatar>
</AvatarGroup>
</div>
);
}childrenCompose AvatarImage, AvatarFallback, and an optional AvatarBadge inside the root.
Type ReactNode
sizeControls the root size and drives badge/fallback sizing through data-size selectors.
Type "default" | "sm" | "lg"·Default "default"
tooltipOptional short label shown in the Iconiq tooltip surface when the entire avatar is hovered or focused.
Type string
tooltipSidePreferred side for the avatar tooltip bubble. The default collision order is right, left, top, then bottom.
Type "top" | "bottom" | "left" | "right"·Default "right"
tooltipDelayDelay in seconds before the avatar tooltip opens.
Type number·Default 0.15
tooltipClassNameMerged onto the tooltip bubble when the avatar tooltip is enabled.
Type string
classNameMerged onto the Base UI avatar root. Use it for local radius, ring, or size overrides.
Type string
srcImage URL passed to the underlying Base UI image primitive.
Type string
altAccessible text for the image. Pass an empty string only when the avatar is decorative.
Type string
classNameMerged with the full-size rounded image classes.
Type string
childrenInitials, icon, or other compact fallback content centered inside the avatar.
Type ReactNode
classNameMerged with the muted circular fallback classes.
Type string
childrenOptional icon or status mark. Small avatars hide nested SVGs automatically.
Type ReactNode
tooltipOptional short label shown in the Iconiq tooltip surface when only the badge should be the trigger.
Type string
tooltipSidePreferred side for the tooltip bubble. The default collision order is right, left, top, then bottom.
Type "top" | "bottom" | "left" | "right"·Default "right"
tooltipDelayDelay in seconds before the tooltip opens.
Type number·Default 0.15
tooltipClassNameMerged onto the tooltip bubble when the badge tooltip is enabled.
Type string
classNameMerged with the green status badge background, foreground, and ring classes.
Type string
childrenAvatar and AvatarGroupCount children rendered in an overlapping row.
Type ReactNode
classNameMerged with the negative-space group classes and child avatar rings.
Type string
childrenCount label or icon shown after the visible avatars.
Type ReactNode
classNameMerged with the muted circular count chip classes.
Type string
Contact
Additionally, if you find any bug or issue, feel free to raise an issue.
Assigned toSUand reviewed by