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.
Usage#
There 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#
Color#
The Avatar component generates a unique background color based on the label prop you provide.
Code#
Filled Avatar#
The Avatar component can have a filled color by providing filled boolean prop.
Code#
Size#
The size of the Avatar can be varied by using the size prop which accepts number values. By default the size is 40.
Code#
Image Avatar#
The Avatar component can be used to render images as avatar if src prop is provided.
Both
srcandlabelprop has to be given for image avatar.

Code#
API#
| Prop | 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 🤙