Function: Avatar()
Avatar(
props
):Element
The Avatar component is a UI element used to display a user's profile picture or initials. It supports various features such as image source handling, fallbacks (e.g., initials or default image), and customization options for styling and sizes.
Parameters
Parameter | Type | Description |
---|---|---|
props | AvatarProps | Avatar component props |
Returns
Element
See
Storybook - Avatar (opens in a new tab)
Example
<Avatar
src="https://example.com/nonexistent.jpg"
alt="Annabel B"
initials="AB"
size={40}
backgroundColor="#789abc"
/>
Defined in
packages/react-material-ui/src/components/Avatar/Avatar.tsx:45 (opens in a new tab)