Source Code

<div class="ast-wrap">
  <div class="ast-head">
    <h2>Agent run</h2>
    <span class="ast-badge" id="astBadge">Running</span>
  </div>
  <div class="ast-timeline" id="astTimeline"></div>
  <div class="ast-summary" id="astSummary" hidden></div>
</div>

AI Agent Step Timeline — Free HTML CSS JS Snippet

AI Agent Step Timeline · Dashboards · Plain HTML, CSS & JS · Live preview

What's included

Features

Vertical timeline with pending, running (pulsing), and done (checkmark) states per step
Sequential step progression simulated with chained setTimeout calls and randomized per-step duration
Connecting line between steps changes color as earlier steps complete
Animated pulsing ring indicator on the currently-running step via CSS keyframes
Real elapsed-time tracking from a captured start timestamp, shown in a final summary line
Status badge in the header that switches from "Running" to "Completed" automatically
Single render() function rebuilds the whole timeline from step state, keeping UI and data in sync
No external API calls — the entire agent run is a client-side simulation

About this UI Snippet

AI Agent Step Timeline — Simulated Live Agent Run Progress Timeline

Screenshot of the AI Agent Step Timeline snippet rendered live

Agentic AI products often show users a live trace of what the agent is currently doing — searching, reading documents, calling tools — rather than a single opaque loading spinner. This snippet fakes that experience client-side using a hardcoded step list and chained setTimeout calls, so it can be dropped into a demo or design mockup without any real agent backend.

Steps carry their own status, driving one render function

Each entry in the STEPS array gets a status field of 'pending', 'running', or 'done'. A single render() function rebuilds the entire timeline's HTML from that array every time it's called — there's no separate DOM-patching logic per step, which keeps the rendering logic simple and impossible to get out of sync with the underlying data.

Sequential progress via chained setTimeout, not setInterval

runNextStep() marks the current step 'running', waits a randomized duration (900–1500ms) to simulate real work, marks it 'done', then calls itself again after a short pause for the next step — recursing until every step is complete. Chaining timeouts like this (rather than one fixed-interval loop) lets each step take a different, slightly randomized amount of time, which reads as more realistic than a perfectly uniform tick.

Distinct visual states per step

Pending steps show a plain gray-outlined circle; the running step shows an indigo-outlined circle with a CSS @keyframes ring that scales outward and fades, giving a pulsing "in progress" animation; done steps show a filled indigo circle with a checkmark icon. The connecting line between steps also changes color once a step is done, so completed portions of the timeline are visually distinct from what's still ahead.

A real elapsed-time summary

The run's actual start time is captured once via Date.now() when the timeline begins. When the last step finishes, the elapsed seconds are computed from that real timestamp rather than a hardcoded number, so the "Completed in Xs" summary reflects the actual simulated run duration.

Step by step

How to Use

  1. 1
    Load the snippetClick "AI Agent Step Timeline" in the sidebar to load its HTML, CSS, and JS into the editor panels. The preview updates instantly.
  2. 2
    Edit the codeModify any panel — HTML, CSS, or JS. The preview refreshes as you type. Use Reset in each panel header to restore the original.
  3. 3
    Preview on devicesClick the Mobile (375px), Tablet (768px), or Desktop buttons in the preview header to check responsiveness.
  4. 4
    Export in your formatClick "HTML" to download a standalone file, "JSX" for a React component, "Tailwind" for a React + Tailwind CSS component, "Tailwind HTML" for a standalone HTML file with Tailwind CDN, "Vue" for a Vue 3 SFC with <template>/<script setup>/<style scoped>, or "Angular" for a standalone Angular .component.ts file. "Copy all" copies the full code to clipboard.
  5. 5
    Save your versionClick "Save as", type a name, and press Enter. Your snippet saves to IndexedDB and appears in the Saved tab.

Real-world uses

Common Use Cases

AI agent and copilot product dashboards
Show users a believable live trace of an agent working through a multi-step task.
Reference for wiring a real agent event stream to a UI
Swap the setTimeout simulation for real step-completion events from your agent backend.
Product demos and marketing pages for agentic features
Demonstrate an agent workflow visually without needing a live backend during a demo.
Teaching sequential async UI simulation
A clear example of chaining setTimeout calls to simulate a multi-stage async process.

Got questions?

Frequently Asked Questions

No. All four steps and their timing are hardcoded and simulated with setTimeout — no network request or tool execution actually happens.

A startTime timestamp is captured with Date.now() right when the timeline begins. Once the final step finishes, the elapsed time is computed from that real timestamp, so it reflects the actual (simulated) run duration rather than a fixed number.

Chaining setTimeout calls lets each step run for its own randomized duration and only schedules the next step once the current one truly finishes, which produces more natural-looking, non-uniform timing than a fixed-interval tick would.

Replace the setTimeout logic inside runNextStep() with handlers for real step-started/step-completed events (e.g. from a WebSocket or server-sent events stream), calling render() whenever a step's status actually changes.