Gallery state
By Zeeli

Agent Avatar

Animated avatars for agents and sub-agents. characters, four states each, in a single web component with no dependencies.

Install

Install from npm, then import it once. Importing it registers the <agent-avatar> element.

pnpm add agent-avatar
import 'agent-avatar';

Usage

HTML

<agent-avatar variant="teddy" state="working" size="40"></agent-avatar>

React 19

import 'agent-avatar';

export function AgentRow({ agent }) {
  return <agent-avatar variant={agent.avatar} state={agent.status} size={28} />;
}

Reading the catalog

import { CHARACTERS, SETS, STATES, VARIANTS } from 'agent-avatar';

VARIANTS;             // ['mochi', 'byte', ...]
CHARACTERS.rex.title; // 'Rex'
SETS.map((s) => s.title);

Playground

Pick a character, a state and a size. The snippet updates as you go.

Character
State

In context

API

AttributeValuesDefault
variantmochi
stateidle · working · attention · doneidle
sizeNumber in px, or any CSS length. Numbers at 32 or below turn on lite mode.96px
labelAccessible label read by screen readers.Agent <state>

Exports

AgentAvatarThe element class, already registered as <agent-avatar>.
VARIANTSEvery variant name, in catalog order.
CHARACTERSMetadata per variant: title, set, description.
SETSThe catalog groups: Abstract, Characters, Party crew, Wild bunch, Edgy crew.
STATESThe four states.

States

Each state has its own colour, face, motion and corner badge, so it reads even at 16px.

StateColourMeaning
idleLavenderWaiting for work. Blinks and breathes.
workingBlue, typing dotsBusy. Each character uses its prop.
attentionOrange, ! badgeNeeds input or approval from you.
doneGreen, check badgeFinished. Celebrates with sparkles.

Performance

Compositor motionBounce, squash, shadow, badges and sparkles only animate transform and opacity on HTML layers.
No filtersGlows and highlights are baked gradients. No SVG blur runs per frame.
Active state onlyHidden states run no animations.
Offscreen pauseOne shared IntersectionObserver pauses avatars that scroll out of view.
Lite modeAt size 32 or below, idle is static and other states keep one body motion.
Shared resourcesOne stylesheet per variant and a cached template for markup.

Headless Chrome benchmark: 300 avatars at 28px, 50 at 64px and 20 at 96px all hold 60fps.