Avatar

Circular profile image with fallback initials and a presence dot. An optional mode shows presence on the photo itself, bright when online and faded when away or offline.

Preview

Props Changes apply to the live preview above.

Installation

npx @lumioui/cli add avatar

Usage

import { Avatar } from "@/components/ui/avatar/avatar";
<Avatar />

Examples

Fallback

Contacts imported without photos: initials hold the circle, and an unsaved number falls back to the person glyph.

Presence

A team list in a chat app.

Sizes

Each size in the spot it owns on a maker's profile: xl in the header, sm on the "followed by" line, lg on the event row, md in the comments.

API reference

Prop Type Default
size
"sm" | "md" +2 "sm" | "md" | "lg" | "xl"
"md"
source ImageSourcePropType

Image source for the avatar — fades in when it loads.

—
fallback string

Fallback initials shown when no image (or it fails).

—
status keyof typeof statusColors

Presence dot in the corner — chat/status lists.

—
onPress (e: GestureResponderEvent) => void

Makes the avatar tappable (profile → detail).

—
className string —
alt string

Accessibility label — defaults to "Avatar".

"Avatar"
lit boolean

Presence as light (opt-in): the photo is switched on by presence — full when online or busy, dimmed under a surface veil when away (80%) or offline (60%) — and the dot gets a shape per state (filled online, hollow away, barred busy, hollow grey offline). Default false.

false