Dinachi

Avatar

An image element with a fallback for representing a user. Supports multiple sizes and graceful loading states.

View Source

#Installation

npx @dinachi/cli@latest add avatar

#Usage

tsx
import { Avatar, AvatarImage, AvatarFallback } from '@/components/ui/avatar'

#Examples

#API Reference

PropTypeDefaultDescription
size'sm' | 'md' | 'lg''md'The size of the avatar
srcstringThe image source URL for the avatar
altstringAlternative text for the avatar image
fallbackReact.ReactNodeContent to display when the image fails to load or is not provided