No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.


  

Avatar

Avatar component displays user's profile image, initials or fallback icon.

Always add alt description with src provided image and iconLabel description with icon.

Random avatar image
NameDescriptionDefaultControl
alt*
HTML <img> element's alt attribute value
stringundefined
-
color
Avatar's color
"primary""secondary""tertiary""error""success""warning""info""uncolored"
"primary"
radius
Border radius value
"md""xs""sm""lg""xl""none""full""round"
"full"
size
Size value
"md""xs""sm""lg""xl""xxl"
"md"
disabled
Disabled styling
boolean
-
bordered
Sets border of avatar's image wrapper
boolean
-
name
Name that is used to generate initials for a fallback
string
-
fadeInAnimation
Show fade-in animation on initial image load
boolean
-
preloadFallbackSrc

Specifies whether the image from fallbackSrc prop should be loaded upfront or after the image from src

boolean
-
src

Defining src is not allowed when icon prop is used HTML <img> element's src attribute value

string
-
as
ElementType<any>
img
-
icon

Icon element displayed as an avatar. Overrides fallback and fallbackSrc prop values Icon element is not allowed when src prop is used

ReactNode
-
fallback

Fallback element is not allowed when icon prop is used Fallback React element that is displayed during image loading and in case of errors

ReactNode
-
animationDuration
The duration of the fade-in animation
AnimationDuration<string & {}>
-
fallbackSrc

URL to the fallback image. It's displayed during src image loading, in case of load error and if src was not provided.

Overrides fallbackOnError value. If used with fallback, then the fallback will be displayed until fallbackSrc is loaded

string
-
fallbackClassName
Fallbacks' wrapper class attribute
string
-
wrapperClassName
Image wrapper class attribute
string
-
wrapperProps
Image wrapper props
Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "className">
-
ref
any
-

Stories

Default

Random avatar image

Bordered

Random avatar image

Initials Only

Random avatar imageHS

With Icon

Random avatar image

Default Icon Fallback

Random avatar image

Disabled

Random avatar image

Small Radius

Random avatar image

Avatar Group

Random avatar
Random avatar
Random avatar
Number of hidden avatars+2