Skip to main content

Design system components

DonnyAvatar

The assistant's animated avatar with thinking, speaking, and idle mood states, used inside ChatWidget and Donny surfaces.

Status: stable. Group: display. Markdown version: /design-system/components/donny-avatar.md

When to use

The assistant's animated avatar with mood and lifecycle states used inside ChatWidget and Donny surfaces. DONNY_STATES and isDonnyState expose the complete validated state vocabulary to hosts.

When not to use

  • Do not set decorative on a DonnyAvatar unless the parent control carries its own accessible name; a decorative avatar is hidden from assistive technology and names nothing.
  • Do not drive lifecycle-only states such as loading or typing from decorative marketing copy.
  • Do not use random emotional states to imply work or success that has not occurred.

Look-alikes

The contract names no look-alike with a deciding condition.

Props

DonnyAvatar props
PropTypeDefaultDescriptionRequired
state"success" | "error" | "loading" | "idle" | "listening" | "thinking" | "searching" | "confused" | "handoff" | "greeting" | "acknowledging" | "suggesting" | "confident" | "curious" | "celebrating" | "apologetic" | "typing" | "waving" | "remembering" | "focused" | "playful" | "impressed" | "skeptical" | "sleepy" | "sleeping"idleCurrent expression or assistant lifecycle state.No
size"xs" | "sm" | "md" | "lg" | "xl"mdRendered avatar size: xs 28px (chat toggle), sm 32px, md 48px, lg 64px, xl 96px.No
classNamestringnoneAdditional CSS class.No
onTransitionEnd() => voidnoneCalled when the state transition animation ends.No
showLabelbooleanfalseShows the current state label for diagnostics.No
trackMousebooleanfalseMakes the eyes follow the pointer.No
proximitySelectorsstring[][]CSS selectors whose pointer proximity can trigger curious or playful behavior.No
onProximityChange(isNearTarget: boolean, targetSelector?: string) => voidnoneCalled when proximity to a tracked target changes.No
proximityThresholdnumber150Pointer proximity threshold in pixels (default 150).No
enableIdleExpressionsbooleanfalseEnables one randomized idle expression before the avatar settles.No
idleExpressionIntervalnumber12000Delay before the one idle expression, in milliseconds (default 12000), randomized by 50 percent.No
isSpeakingbooleanfalseAnimates the mouth during streaming responses.No
enableSleepDetectionbooleanfalseEnables sleepy and sleeping states after pointer inactivity.No
sleepyDelaynumber120000Inactivity delay before the sleepy state, in milliseconds (default 120000).No
sleepDelaynumber150000Inactivity delay before the sleeping state, in milliseconds (default 150000).No
decorativebooleanfalseSets aria-hidden and removes role and label when a parent control owns the accessible name (e.g. the chat toggle). Otherwise the avatar is an img named by its translated state, such as "Donny is thinking".No

Variants

  • Available sizes: xs, sm, md, lg, xl (default md).
  • Allowed state values: success, error, loading, idle, listening, thinking, searching, confused, handoff, greeting, acknowledging, suggesting, confident, curious, celebrating, apologetic, typing, waving, remembering, focused, playful, impressed, skeptical, sleepy, sleeping (default idle).

Invalid combinations

The contract records no invalid combinations.

Keyboard

The contract records no keyboard interaction.

Rules

Every item under When not to use is a MUST NOT. MUST and SHOULD follow RFC 2119.

DonnyAvatar rules
LevelRuleHow it is checked
MUSTARIA: When not decorative, the root is role=img named by a translated sentence for its state (donnyAvatar.state.<state>, for example "Donny is thinking", "Donny miettii", "Donny tänker"); raw state ids are never announced.Not yet verified: no evidence record. WCAG 4.1.2.
MUSTARIA: Decorative sets aria-hidden on the root and removes the role and the name, so the parent control must carry the accessible name.Not yet verified: no evidence record. WCAG 4.1.2.
MUSTRequired stories produce no axe violations at the configured severity.Automated by npm run test:stories:matrix:ci. WCAG 2.5.8.
MUSTThe accessibility tree (role, name, state) matches the committed snapshot for every required story.Automated by npm run test:stories:matrix:ci. WCAG 1.3.1, 4.1.2.
MUSTThe component remains legible and operable under a real browser forced-colors: active pass.Automated by npm run test:stories:hc.
MUSTA human completed an end-to-end accessibility review of this component.Manual review, last on 2026-11-04.
SHOULDUse lifecycle states such as listening, thinking, searching, typing, and loading to reflect actual assistant work.Not stated in the contract.
SHOULDSet decorative when Donny sits inside an already-labelled button or link.Not stated in the contract.
SHOULDValidate external state strings with isDonnyState before rendering.Not stated in the contract.

Install and import

  • In-repo only. DonnyAvatar is not exported from @digitaltableteur/react, so there is no public import path.