Avatar
Avatar
component is used to render a avatar icon in the user interface. This component is used reperesent user in UI.
They act as an avatar for user.
#
UsageThere are basically two usage either you can use it to render avatar images using src
prop or you can provide a label
prop which is then
used to get a unique avatar based on the label
provided.
#
Code#
ColorThe Avatar component generates a unique background color
based on the label
prop you provide.
#
Code#
Filled AvatarThe Avatar component can have a filled color by providing filled
boolean prop.
#
Code#
SizeThe size of the Avatar can be varied by using the size
prop which accepts number values. By default the size is 40
.
#
Code#
Image AvatarThe Avatar component can be used to render images as avatar if src
prop is provided.
Both
src
andlabel
prop has to be given for image avatar.

#
Code#
APIProp | Type | Possible values | Default Value |
---|---|---|---|
label | string | Any String value | "" |
filled | boolean | true and false | false |
size | number | Any number value | 40 |
src | string | Any image url | -- |
Built by Akshay 🤙