Skip to content

Avatar

Circular avatar with image or fallback initials. The pastel ring glows only while the pointer is over that avatar, so a stack never lights up all at once, and its colour shifts with pointer position via pastelColour. All glow via refs and rAF.

  • requestAnimationFrame
  • Proximity Detection
  • pastelColour

avatar

User

Move your cursor near the avatars.

Usage

Drop it in

import
import { Avatar } from "@/app/lib/components/avatar";
example 1
<Avatar src="https://i.pravatar.cc/80" alt="User" />
<Avatar fallback="SK" size={56} />

API

Props

PropTypeDefault
src

Image URL

string—
alt

Alt text for the image

string""
fallback

Fallback initials when no src is provided

string""
size

Diameter in pixels. Default: 40

number40
className

Additional class names

string""

Read from the component's source at build time. * required.

Accessibility

Works with

Cursor
Reacts to where the pointer is, not just whether it's over the element.
Touch
Follows your finger while it's down, then settles a moment after you lift.
Keyboard
Focus lights it up the way the cursor does. Every action has a key.
Reduced motion
Nothing moves or springs. Colour still answers, without drifting.