Avatar

User or entity image with graceful fallback to initials, plus an overlapping AvatarGroup with a +N overflow indicator.

Installation

npx dafink-ui add avatar

Demo

Composition

<AvatarGroup>
<Avatar />
</AvatarGroup>

Props

NameTypeDefaultDescription
srcstring-Image URL. When set, alt is required (enforced by the prop types).
altstring-Accessible description of the person; required with src, optional otherwise.
namestring-Full name used to derive fallback initials ("Ada Lovelace" → "AL") and the fallback accessible label.
fallbackstring-Explicit fallback text; overrides initials derived from name.
size"sm" | "md" | "lg""md"Avatar dimensions: 28px / 36px / 48px.
shape"circle" | "square""circle"circle is rounded-full; square is rounded-md.
max (AvatarGroup)number-Maximum avatars shown before collapsing the rest into a "+N" indicator.
classNamestring""Additional Tailwind classes merged onto the root element.