Persona Avatar

An agent's face: a shape and a color with eyes that move with what it's doing.

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/persona

Usage

import { PersonaAvatar } from "./ui/uicontext/components/kit/Persona.ts"
export const InboxFace = <M>(h: Html.H<M>, working: boolean) =>	PersonaAvatar(h, { persona: { shape: "drop", color: "blue" }, size: "md", state: working ? "working" : "idle" })

Examples

What it's doing

Idle blinks, thinking glances, working bobs, waiting shows an amber dot, blocked a red one. Under reduced motion the faces hold still and the dots stay.

Idle
Thinking
Working
Needs you
Blocked
Done

Sizes

16 and 20 for trees and headers, 32 for lists, 44 for a phone's pinned row, 96 for a new agent's preview.

API reference

Options

PersonaAvatar options
NameTypeDefaultDescription
personarequiredPersona——
size"xs" | "sm" | "md" | "lg" | "xl"—16, 20, 32, 44 or 96 pixels; md (32) by default
state"idle" | "thinking" | "working" | "waiting" | "blocked" | "done"idleWhat it's doing, shown as motion and a dot; idle by default
labelstring—A name for screen readers; decorative (hidden) when the agent's name sits beside it
styleStyle——

Source