Skip to Content
DocumentationAvatar

Avatar

An image element with a fallback for representing the user.

Examples

Variants

CN
CN
LR
ER

Fallback

ER

Sizes

CN
ER
LR
ER

With Badge

8CN
3ER
20LR
47ER

API

Avatar

PropertyTypePossible valuesDefaultDescription
size”sm” | “md” | “lg” | “xl""sm”, “md”, “lg”, “xl""md”Sets the size of the avatar.
badgeReact.ReactNode--Content displayed as a badge on the avatar (typically for notifications or counters).
classNamestring--Additional CSS classes to apply to the avatar.
childrenReact.ReactNode--Child components (typically AvatarImage and AvatarFallback).
…propsAll Radix Avatar props--Allows passing any other standard properties of components.

AvatarImage

PropertyTypePossible valuesDefaultDescription
srcstring--The source URL of the avatar image.
altstring--Alternative text for the avatar image.
classNamestring--Additional CSS classes to apply to the avatar image.
…propsAll Radix AvatarImage props--Allows passing any other standard properties of components.

AvatarFallback

PropertyTypePossible valuesDefaultDescription
childrenReact.ReactNode-User iconContent to display when the avatar image fails to load. Defaults to a User icon if no children provided.
classNamestring--Additional CSS classes to apply to the avatar fallback.
…propsAll Radix AvatarFallback props--Allows passing any other standard properties of components.
Last updated on