Avatar

An image element with a fallback for representing the user.

Anatomy

<Avatar.Root>
  <Avatar.Image />
  <Avatar.Fallback />
</Avatar.Root>

Usage

import { Avatar } from '@ivaldi/ui'
<Avatar.Root>
  <Avatar.Image src="https://github.com/shadcn.png" alt="@shadcn" />
  <Avatar.Fallback>CN</Avatar.Fallback>
</Avatar.Root>

Avatar.Composed Props

Composed Avatar component that combines Root, Image, and Fallback Provides a complete avatar solution with image and fallback handling

PropTypeDefault
srcstring
altstring
fallbackany
imagePropssee more"{}"
fallbackPropsany"{}"
classNamestring
childrenReactNode
asChildboolean

Avatar.Root Props

Root component for the Avatar system Provides context and styling for Avatar subcomponents

PropTypeDefault
classNamestring
childrenReactNode
asChildboolean

Avatar.Fallback Props

Fallback component for the Avatar Displayed when the main image fails to load

PropTypeDefault

Avatar.Image Props

Image component for the Avatar Displays the main avatar image with proper sizing and aspect ratio

PropTypeDefault
onLoadingStatusChangefunction
classNamestring
childrenReactNode
asChildboolean