Agent avatar

Free

The agent's face in four looks, 3D plush, glass orb, flat shape or pixel, in any color, acting out its work: it searches with a magnifier, reads, scribbles, asks and hops when it's done.

npx shadcn@latest add https://pixilui.com/r/agent-avatar.json

Preview

The agent's face acts out its work, blinking on every change and hopping when done.
Family
3D shape
2D shape
Flat shape
Pixel shape
State
Color

When to use

Use it when

  • The agent's face in agent lists, inboxes, run headers, stacks and the working line: who it is (shape and color) and what it is doing (eleven states) at once.
  • A product with several agents: give each a family, shape and color of its own and keep them.
  • 24 to 240px. Under 56 the props hide; under 36 the ornaments grow so the state still reads.

Use something else when

  • A person: use the avatar (initials, figure or photo).
  • Beside the activity mark: the mark leads the trail's working line, the avatar is the face; one or the other.
  • A run's status in words: pair it with agent status.

Installation

Terminal
npx shadcn@latest add https://pixilui.com/r/agent-avatar.json

Adds agent-avatar.tsx, and installs clsx and tailwind-merge. The URL works in any app with a components.json, with no registry to add first.

Usage

example.tsx
import { AgentAvatar } from "@/components/pixilui/agent-avatar";

<AgentAvatar />

A square of size pixels. Props hide under 56 and the 2D face grows 1.1 times there; under 36 the ornaments grow 1.75 times into badge-sized marks.

API reference

PropTypeDefault
family"3d" | "2d" | "flat" | "pixel""3d"The look: 3d plush (default), 2d glass, flat or pixel.
shape"orb" | "drop" | "block" | "bean" | "cloud" | "dome" | "clover" | "star" | "waves" | "tide" | "ripple" | "bloom" | "heart" | "circle" | "squircle" | "pill" | "blob" | "flower" | "egg" | "tri"–One of the family's shapes (agentAvatarShapes[family]); the family's first by default.
colorAgentAvatarColor | (string & {})"blue"A named color (pink, blue, lime, tangerine, violet, yellow, cyan, red) or any CSS color.
state"idle" | "thinking" | "searching" | "reading" | "writing" | "browsing" | "running" | "waiting" | "done" | "failed" | "stopped""idle"What the agent is doing. Every change blinks; done hops on arrival, failed shivers once.
sizenumber64CSS pixels. Under 56 the props hide; under 36 the ornaments grow 1.75x so the state still reads.
namestring"Agent"The agent's name, the start of its accessible name ("Ada, searching").
stateLabelsPartial<Record<AgentAvatarState, string>>–The words for each state in the accessible name, for translation (default: the state's id).

Also takes every native <span> attribute except color, and a ref.

Keyboard

TabNever takes focus: put the avatar inside the row or button that carries the action.

Accessibility

  • role img with the name and the state ("Ada, searching"; the name alone when idle), updated on every change; stateLabels translates the state words.
  • The drawing is aria-hidden. State is never color alone: the face, the prop and the ornaments show it.
  • Reduced motion: no blink, no loops; the new look shows at once, done shows the happy face without the hop.

Motion

  • Every change of state blinks (240ms) and the new look swaps in while the eyes are shut; done hops (760ms), failed shivers once (440ms); flat wobbles like jelly (640ms), pixel winks and bursts confetti on done.
  • Each state loops its own act: thought bubbles rise, the magnifier sweeps, the eyes run along lines, the pencil scribbles, a sweat drop drips, a question bubble asks, z's float up.
  • 2D, flat and pixel look toward the pointer while idle or waiting; 2D and flat lean up to 4 degrees.
  • Changing the color updates the 3D gradient map in place, with no blink. Nothing plays on first render.

PixilUI Pro opens soon. The first 20 licenses are $99.