Skip to content

Agent Loader

A small inline loader for an agent run. One glyph for each phase (thinking, searching, reading, writing, running a tool, waiting for you, done, failed), a short label and an optional timer, small enough for a chat bubble, a button, a table row or a toast.

On this page
Used for
  • Chat bubble
  • Button while it runs
  • Table row status
  • Toast
  • Status bar

Examples

Phase
Size
Tone

Every phase

Finishing a run

In a chat bubble

On a button

In a table row

In a toast

Installation

npx knowns-ui@latest add agent-loader
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

phase
"think" | "search" | "read" | "write" | "tool" | "wait" | "done" | "error"
The step the run is in. Picks the glyph, its loop and its colour.
label
string
Defaulta word for the phase
Text next to the glyph, e.g. "Searching the docs". Changing it settles the new text in.
showLabel
boolean
Defaulttrue
false leaves just the glyph. A screen reader still hears the label.
startedAt
number | Date
When the run started. Shows the elapsed time and ticks it while the agent is busy.
endedAt
number | Date
When it ended. The time stops there; without it the time holds at the moment the run finished.
elapsed
number
Seconds, if you track them yourself. Wins over startedAt.
size
"sm" | "md" | "xl"
Default"sm"
16px, 20px, or a 112px mark for a hero or a status panel.
layout
"inline" | "stack"
Default"inline" ("stack" for xl)
Label beside the glyph, or centred under it, the time beside the label.
morph
boolean
Defaulttrue for xl
On a phase change, the old glyph twists out and the new one twists in (280ms, ease in-out) instead of the 120ms crossfade.
tone
"accent" | "neutral"
Default"accent"
Tint of a working glyph. Waiting (amber), done (green) and failed (red) always keep their status colour.
shimmer
boolean
Defaulttrue
Sweep a light band through the label while the agent is busy.
AgentLoaderMark
{ phase, size?, tone?, morph? }
Just the glyph, for a button icon or a row. Decorative: pair it with text.

What it handles

  1. 01Gives each phase of an agent run its own small glyph and loop: dots that breathe, a lens that sweeps, lines that scan, a caret that writes, brackets that pulse, a ring that asks for you.
  2. 02Crossfades the glyph when the phase changes and swaps the label with a short settle.
  3. 03Plays done and failed once: a check that draws, or a shake and an X. A run that arrives already finished paints still.
  4. 04Shows an optional elapsed time that ticks once a second while the agent is busy and stops when the run ends.
  5. 05Tells a screen reader the label once per phase change, not on every tick.
  6. 06Fits a button, a bubble, a table cell or a toast at 16 or 20px, in light and dark.

States

First render
Only the loop of an active phase. Done and failed paint still
none
Active phase
The glyph loops: breathe, sweep, scan, write, pulse; the label shimmers
1.3 to 2.2s per loop, ease in-out
Phase change
The old glyph fades out as the new one fades in; the label settles
120ms out, 180ms in, ease out
Waiting for you
A slow ring pulses, amber; the label does not shimmer
2.2s, ease out
Done
The ring pops and the check draws once
280ms, ease out
Failed
The glyph shakes once and the X draws
280ms, ease out
Phase change, xl or morph
The old glyph twists out (60 degrees) as the new one twists in; the mark reads as one thing changing shape
280ms, ease in-out
Reduced motion
A still glyph for each phase, no loop, no shimmer
0ms

Works with

When to use

When to use

  • A one-line loader for an agent run in a chat bubble, a button, a table row, a toast or a footer.
  • Telling someone the agent is waiting on them, not working.

When not to use

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Agent Loader to my app and wire it to my own data.
  • I need a one-line loader for an agent run in a chat bubble, a button, a table row, a toast or a footer. Set that up with the Knowns UI Agent Loader.
  • Which Agent Loader props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "agent-loader" }) and search_docs({ query: "agent loader" }).

Need help?

Stuck on Agent Loader, or found something off? We read every message.