Library navigation
AMAMAM

Avatar

A profile image with initials and an image-error fallback.

Installation

bunx shadcn@latest add https://ui.razeev.com/r/avatar.json

Usage

tsx
import { Avatar } from "@/components/hangry-ui/components/avatar";
<Avatar name="Alex Morgan" src="/avatar.jpg" />

Props

PropTypeDefaultDescription
srcstring—Profile image URL. Shows initials if omitted or the image fails.
namestring"Alex Morgan"Accessible name and source for the initials.
sizenumber48Width and height in pixels.
classNamestring""Additional CSS classes on the component root.

Setup notes

Use Tailwind CSS v4. Borders use the global border-border token. No rounded classes or additional packages are required. Customize content with props and styling with className.