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.

Cross-platform drift (tracked for reconciliation)

The look is approved off the shipped Android avatar; the rest is designed here and awaits sign-off:

  • Component vs. inline: Android now ships NockerlAvatar (com.dizyx.nockerl.design.components), the published wrapper that folds the raw Image().clip(CircleShape) pattern (GlobalTopBar + AvatarSettingsSheet) into one disc with the ratified size ramp + image → initials ladder. Voice ships none; the Swift API above is intended.
  • Fallbacks: the published Kotlin avatar covers image → initials (a blank name renders the "?" placeholder). A dedicated person-icon fallback is not yet shipped; it’s still a proposed rung across all platforms.
  • Presence & stacks: the published Kotlin avatar takes an optional bottom-right presence dot (a palette-dot color, notched into the host surface). The overlapping +N stack is still designed-only: there is no NockerlAvatarStack on any platform yet.
  • Shape: only circle is shipped (the published Kotlin default). rounded is proposed.