Glim Guides · Design pattern

The four-state mind design pattern for AI interfaces

A practical design pattern for AI UIs: idle, listening, thinking, talking — how to map model events to a readable public mind users trust.

2026-07-22 9 min read For AI product builders

Design systems are full of buttons and toasts. Few ship a pattern for machine attention. The four-state mind is a small vocabulary that product, design, and eng can share without a 40-page spec.

The four states

StateUser-facing meaningTypical trigger
IdleHere, not workingApp ready / turn complete
ListeningReceiving youFocus in composer, voice capture, drag-drop
ThinkingWorking on itRequest in flight, tool calls, retrieval
TalkingAnsweringToken stream, TTS playback, final message

Why four beats “loading: boolean”

A boolean collapses listening and thinking into the same gray spinner. Users lose the difference between “type whenever” and “I heard you; computing.” Four states restore conversational turn-taking.

Implementation sketch

// Pseudocode — works with Glim or your own renderer
onComposerFocus()  -> mind.set('listening')
onSubmit()         -> mind.set('thinking')
onFirstToken()     -> mind.set('talking')
onStreamEnd()      -> mind.set('idle')
onAbort()          -> mind.set('idle')
onError()          -> mind.set('idle') // plus a toast

Motion and color rules

Glim as a reference implementation

Glim encodes this pattern as Glim.mount(el, type, opts) plus setState. Themes remap the mood palette without rewriting creatures. Free types are MIT; try before you invent a parallel state enum in every app.

Try Glim free. Offline starter + MIT creatures. No fake checkout.