Skip to main content

Avatar

A user avatar that settles from a blur as the image loads, falls back to initials, shows a presence badge, and fans out in groups.

KNLTANMK
+8
size="default"·pulse:false·spread:true

Customize

SizeDefault
Reveal blur (px)4
Speed1

Installation

npx shadcn@latest add @kinetic/avatar

Usage

Render an AvatarImage with an AvatarFallback for when the image is missing or slow.

import { Avatar, AvatarFallback, AvatarImage } from "@/components/kinetic/ui/avatar";

export function UserAvatar() {
  return (
    <Avatar>
      <AvatarImage src="/avatars/linh.png" alt="Linh Tran" />
      <AvatarFallback>LT</AvatarFallback>
    </Avatar>
  );
}

Sizes

Use size with sm (24 px), default (32 px) or lg (40 px).

<Avatar size="lg">...</Avatar>

Badge

Add AvatarBadge for presence. pulse adds a soft ring around it. Give it an aria-label.

<Avatar>
  <AvatarFallback>LT</AvatarFallback>
  <AvatarBadge pulse aria-label="Online" />
</Avatar>

Group

Stack avatars in AvatarGroup and end with AvatarGroupCount. With spread (on by default) the stack fans apart on hover.

<AvatarGroup>
  <Avatar>
    <AvatarFallback>AN</AvatarFallback>
  </Avatar>
  <Avatar>
    <AvatarFallback>MK</AvatarFallback>
  </Avatar>
  <AvatarGroupCount>+4</AvatarGroupCount>
</AvatarGroup>

Fallback delay

Set delayMs on AvatarFallback so fast images never flash the initials. onLoadingStatusChange on the image reports loading progress.

<AvatarFallback delayMs={150}>LT</AvatarFallback>

Motion preferences

Use blurPx and speed to tune the image settle and the fallback crossfade. Reduced motion shows the image and badge without animation.

API Reference

Avatar

Zero-dependency circular avatar frame providing shared blur, speed, and image loading context.

PropTypeDefaultDescription
size"sm" | "default" | "lg""default"Selects 24px (sm), 32px (default), or 40px (lg) square dimensions.
blurPxnumber4Initial blur radius in pixels cleared as AvatarImage finishes loading (clamped 0-16).
speednumber1Animation speed multiplier shared by image settle, fallback crossfade, and badge pop-in (clamped 0.25-4).

AvatarImage / AvatarFallback

WAAPI blur-scale image reveal and delayed fallback initials with smooth crossfade exit.

PropTypeDefaultDescription
src / alt (AvatarImage)stringalt=""Image source URL and descriptive alternative text defaulting to an empty string.
onLoadingStatusChange (AvatarImage)(status: AvatarLoadingStatus) => void-Notifies listeners when loading transitions across idle, loading, loaded, or error.
delayMs (AvatarFallback)number0Delay in milliseconds before rendering fallback initials.

AvatarBadge / AvatarGroup / AvatarGroupCount

Pop-in corner status dot with optional WAAPI pulse ring, Euler spring hover-spread stack, and overflow counter.

PropTypeDefaultDescription
pulse (AvatarBadge)booleanfalseAdds a continuous WAAPI pulse ring around the corner badge, honoring reduced motion and tempo.
spread (AvatarGroup)booleantrueFans stacked avatars apart via sub-stepped Euler springs on fine-pointer hover and gently lifts the hovered item.
speed (AvatarGroup)number1Spring speed multiplier for AvatarGroup hover spread and lift (clamped 0.25-4).

Notes

Always include AvatarFallback inside every Avatar so broken or slow images remain legible, and provide meaningful alt text on AvatarImage.