Skip to content

Avatar

Free

Shows a person or a workspace as a photo, initials, or an icon. Initials show while the photo loads, and a small badge can show if the person is online.

  • Base UI
  • React 19
  • Tailwind CSS 4

Added Nov 8, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Pass an image and a fallback.

user-avatar.tsx

Avatar

<div>
PropTypeDefaultDescription
insetbooleanfalse
rounded"default""full"—
size"default""lg""sm""xl""xs"—
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

AvatarImage

<img>
PropTypeDefaultDescription
classNamestring—
plainbooleanfalseA plain <img> over the fallback, with no load state (only src, alt, and ref pass), for a virtual list that mounts avatars on each scroll frame. A failed photo shows the fallback.
From Base UIAvatar.ImageBase UI docs
onLoadingStatusChange—Callback fired when the loading status changes.
keepMountedbooleanfalseWhether the image element stays mounted and loads in place instead of being preloaded. Supports loading="lazy" and optimized image components such as next/image.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
...props<img> attributes—Every other attribute goes to the <img>, with a ref.

AvatarFallback

<span>
PropTypeDefaultDescription
classNamestring—
From Base UIAvatar.FallbackBase UI docs
delaynumber0How long to wait before showing the fallback. Specified in milliseconds.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<span> attributes—Every other attribute goes to the <span>, with a ref.

AvatarBadge

<span>
PropTypeDefaultDescription
status"away""busy""default""offline""online"—
...props<span> attributes—Every other attribute goes to the <span>, with a ref.
  • Compose AvatarImage and AvatarFallback, so a broken photo shows initials. For a person, put personInitials(name) in the fallback.
  • Use AvatarGroup for a stack: the avatars take its size and rounded.
  • Use inset for a logo or a site icon on a muted fill.
  • For a short status word, use a Badge.

The name comes from alt on the image. Next to a visible name, leave it empty.

An AvatarGroup of decoration takes aria-hidden.

Image
fade · the image fades in when it loads

Built with

Installs with Avatar

Components
Dot
  1. AddedAvatar, with Dot.
Open the release