Avatar
An avatar displays a user’s profile picture or a representative image, often used to visually identify or represent a user.
Usage
AH
<script> import { Avatar } from 'deskblocks'; </script> <Avatar name="Alexander Hipp" src="/assets/avatar/pic1.jpg" />
Fallback
AH
AH
<Avatar name="Alexander Hipp" src="/assets/avatar/pic1.jpg" /> <!-- No Image --> <Avatar name="Alexander Hipp" src="" /> <!-- No Initial & Image --> <Avatar src="" />
Size
<Avatar size="small" src="/assets/avatar/pic3.jpg" /> <Avatar size="medium" src="/assets/avatar/pic3.jpg" /> <Avatar size="large" src="/assets/avatar/pic3.jpg" /> <!-- Custom Size --> <Avatar size={50} src="/assets/avatar/pic3.jpg" />
Props
src | string | undefined | The URL of the image to be displayed as the avatar. |
name | string | undefined | The name whose initials will be displayed as a fallback if the image is unavailable. |
size | “small” | “medium” | “large” | “medium” | Specifies the size of the avatar. |
class | string | undefined | Custom CSS class name for additional styling. |