Skip to content
Zuno UI
Explore components
EXPLORE
Actions
Forms
Layout
Navigation
Data display
Feedback
Overlays
RESOURCES
Components/Avatar

Avatar

User image with an initials fallback when it fails to load.

Base UI reference ↗
AR

Installation

Run it from the root of a project already set up with zunoui init.

npx zunoui@latest add avatar

Dependencies

What add avatar installs alongside the component. The CLI skips any you already have in a compatible version.

ZUNO registry

  • @zuno/utils

npm

Examples

3 examples · 1 component
avatar
ARLM+3

Image with fallback

If the image fails to load, the initials are shown.

avatar
SMMDLG

Sizes

Three sizes: sm (32 px), default (40 px) and lg (48 px). The fallback font scales with the avatar.

avatar
ARLMTS+3

Stacked group

Several overlapping avatars composed together.

API reference

Keeps the props, events and refs of the matching Base UI primitive, plus ZUNO's styles.

PropTypeDefault
Avatar

Round container; control its size with the size prop.

span—
size

Avatar size: 32, 40 or 48 px, with the fallback font scaled to match.

"sm" | "default" | "lg""default"
AvatarImage

Image; fades in when loaded and hides if it fails.

img—
AvatarFallback

Alternative content (initials or an icon).

span—

States

The states that apply to this component and their visual treatment.

StateTreatment
LoadingShows the fallback while the image loads.
LoadedThe image fades in and covers the container.
FallbackIf the image fails, the initials or an icon remain.

Accessibility

Give AvatarImage a descriptive alt with the person's name.

The fallback appears while the image loads or if it fails; use initials or an icon, not color alone.