Color Schemes for Avatar are not implemented in the default theme. You can extend the theme to implement them.
Avatar
The Avatar component is used to represent user, and displays the profile picture, initials or fallback icon.
Props#
Avatar Props#
Avatar composes the Box component so you can pass all its props. These are
props specific to the Avatar component:
colorScheme
colorSchemestringgetInitials
getInitialsFunction to get the initials to display
((name: string) => string)icon
iconThe default avatar used as fallback when name, and src
is not specified.
React.ReactElementiconLabel
iconLabelstringignoreFallback
ignoreFallbackIf true, opt out of the avatar's fallback logic and
renders the img at all times.
booleanloading
loadingDefines loading strategy
"eager" | "lazy"name
nameThe name of the person in the avatar.
- if src has loaded, the name will be used as the alt attribute of the img
- If src is not loaded, the name will be used to create the initials
stringonError
onErrorFunction called when image failed to load
(() => void)referrerPolicy
referrerPolicyDefining which referrer is sent when fetching the resource.
React.HTMLAttributeReferrerPolicyshowBorder
showBorderIf true, the Avatar will show a border around it.
Best for a group of avatars
booleansize
size"2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full""md"src
srcThe image url of the Avatar
stringsrcSet
srcSetList of sources to use for different screen resolutions
stringvariant
variantVariants for Avatar are not implemented in the default theme. You can extend the theme to implement them.
stringAvatar Group Props#
AvatarGroup composes the Box component so you can pass all its props. These
are props specific to the AvatarGroup component:
childrenrequired
childrenrequiredThe children of the avatar group.
Ideally should be Avatar and MoreIndicator components
ReactNodecolorScheme
colorSchemeColor Schemes for AvatarGroup are not implemented in the default theme. You can extend the theme to implement them.
stringmax
maxThe maximum number of visible avatars
numbersize
sizeSizes for AvatarGroup are not implemented in the default theme. You can extend the theme to implement them.
stringspacing
spacingThe space between the avatars in the group.
SystemProps["margin"]"-0.75rem"variant
variantVariants for AvatarGroup are not implemented in the default theme. You can extend the theme to implement them.
string