Skip to content

Avatar

In review
Live · web

Fallback ladder: image → initials → icon

Image

AR

Initials

MP

Initials

NockerlIcon

Broken src → initials

Sizes: xs · sm · md · lg · xl

RSRSRSRSRS

Shape: circle (Android default) vs rounded square

JLJL

Presence: status dot, bottom-right (streaming pulses)

active

streaming

RS

attention

SO

idle

CD

offline

disabled

Interactive: the top-bar avatar (tab to it, click it)

Group / stack: overlap + “+N” overflow chip

SOJL+3
SOJLRSCD+1
SO

NockerlAvatar tapped 0 times. The island is live.

// Web: React, consuming @dizyx/nockerl-tokens. (Web is the laggard platform;
// this is the canonical API the published @dizyx/nockerl-react package exposes.)
import { NockerlAvatar, NockerlAvatarStack } from '@dizyx/nockerl-react';
export function SessionHeader() {
return (
<>
{/* image → initials → icon, in that order */}
<NockerlAvatar src={user.photoUrl} name="Ada Lovelace" size="md" presence="active" onClick={openSettings} />
<NockerlAvatar name="Alex Rivera" size="md" /> {/* initials fallback */}
<NockerlAvatar size="md" /> {/* icon fallback (no name) */}
{/* overlapping group with a "+N" overflow chip */}
<NockerlAvatarStack people={members} max={4} size="sm" />
</>
);
}
PropTypeDefaultDescription
srcstringImage URL. When set (and it loads) it wins over the initials/icon fallback.
namestringFull name. Used for the accessible label and to derive the initials + tint.
sizeNockerlAvatarSize'md'Pixel diameter ramp.
shapeNockerlAvatarShape'circle'Circle (the Android default) or a 12px rounded square.
presencePresencePresence/status dot, bottom-right. Status colors only, never the brand cyan.
disabledbooleanfalseInert + desaturated (never invisible) state.
onClick(e: React.MouseEvent<HTMLButtonElement>) => voidMakes the avatar a focusable button (e.g. the top-bar → settings tap target). Receives the MouseEvent so trigger callers can anchor to e.currentTarget.

Also accepts the native <button> attributes (e.g. onClick, disabled, id, aria-*, data-*), forwarded straight through, plus a forwarded ref.

AvatarStack takes people: { name; src? }[], max (default 4), and size. It overlaps the first max avatars and appends a +N overflow chip.