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
colorScheme
string
getInitials
getInitials
Function to get the initials to display
((name: string) => string)
icon
icon
The default avatar used as fallback when name
, and src
is not specified.
React.ReactElement
iconLabel
iconLabel
string
ignoreFallback
ignoreFallback
If true
, opt out of the avatar's fallback
logic and
renders the img
at all times.
boolean
loading
loading
Defines loading strategy
"eager" | "lazy"
name
name
The 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
string
onError
onError
Function called when image failed to load
(() => void)
referrerPolicy
referrerPolicy
Defining which referrer is sent when fetching the resource.
React.HTMLAttributeReferrerPolicy
showBorder
showBorder
If true
, the Avatar
will show a border around it.
Best for a group of avatars
boolean
size
size
"2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full"
"md"
src
src
The image url of the Avatar
string
srcSet
srcSet
List of sources to use for different screen resolutions
string
variant
variant
Variants for Avatar
are not implemented in the default theme. You can extend the theme to implement them.
string
Avatar Group Props#
AvatarGroup
composes the Box
component so you can pass all its props. These
are props specific to the AvatarGroup
component:
children
required
children
required
The children of the avatar group.
Ideally should be Avatar
and MoreIndicator
components
ReactNode
colorScheme
colorScheme
Color Schemes for AvatarGroup
are not implemented in the default theme. You can extend the theme to implement them.
string
max
max
The maximum number of visible avatars
number
size
size
Sizes for AvatarGroup
are not implemented in the default theme. You can extend the theme to implement them.
string
spacing
spacing
The space between the avatars in the group.
SystemProps["margin"]
"-0.75rem"
variant
variant
Variants for AvatarGroup
are not implemented in the default theme. You can extend the theme to implement them.
string
Props#
Avatar Props#
Avatar
composes the Box
component so you can pass all its props. These are
props specific to the Avatar
component:
colorScheme
colorScheme
Color Schemes for Avatar
are not implemented in the default theme. You can extend the theme to implement them.
string
getInitials
getInitials
Function to get the initials to display
((name: string) => string)
icon
icon
The default avatar used as fallback when name
, and src
is not specified.
React.ReactElement
iconLabel
iconLabel
string
ignoreFallback
ignoreFallback
If true
, opt out of the avatar's fallback
logic and
renders the img
at all times.
boolean
loading
loading
Defines loading strategy
"eager" | "lazy"
name
name
The 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
string
onError
onError
Function called when image failed to load
(() => void)
referrerPolicy
referrerPolicy
Defining which referrer is sent when fetching the resource.
React.HTMLAttributeReferrerPolicy
showBorder
showBorder
If true
, the Avatar
will show a border around it.
Best for a group of avatars
boolean
size
size
"2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "full"
"md"
src
src
The image url of the Avatar
string
srcSet
srcSet
List of sources to use for different screen resolutions
string
variant
variant
Variants for Avatar
are not implemented in the default theme. You can extend the theme to implement them.
string
Avatar Group Props#
AvatarGroup
composes the Box
component so you can pass all its props. These
are props specific to the AvatarGroup
component:
children
required
children
required
The children of the avatar group.
Ideally should be Avatar
and MoreIndicator
components
ReactNode
colorScheme
colorScheme
Color Schemes for AvatarGroup
are not implemented in the default theme. You can extend the theme to implement them.
string
max
max
The maximum number of visible avatars
number
size
size
Sizes for AvatarGroup
are not implemented in the default theme. You can extend the theme to implement them.
string
spacing
spacing
The space between the avatars in the group.
SystemProps["margin"]
"-0.75rem"
variant
variant
Variants for AvatarGroup
are not implemented in the default theme. You can extend the theme to implement them.
string