Skip to Content
Kokonut UI

AI-22AINew, October 21, 2026

AI Agent Lanes

A lead agent hands work to sub-agents that run side by side. Each gets a lane of tool calls, and you can scrub through the whole run.

Install with
lucide-react, motion

Usage

With no props it plays the demo run, with Play and a scrubber. Pass elapsed (seconds since your run started) and it draws the run as it stands instead: no playback controls, each lane's bars growing to the playhead. Leave end off a step while it's running and it pulses until you set it. The answer shows as you pass it, so you can stream it straight in.

"use client";

import { useEffect, useState } from "react";
import AIAgentLanes, { type AgentLane } from "@/components/kokonutui/ai-agent-lanes";

export function RunView({
  startedAt,
  lanes,
  answer,
}: {
  /** When the run began, from Date.now(). */
  startedAt: number;
  /** Your run's lanes; a step has no `end` until it finishes. */
  lanes: AgentLane[];
  answer: string;
}) {
  const [elapsed, setElapsed] = useState(0);

  useEffect(() => {
    const tick = setInterval(() => setElapsed((Date.now() - startedAt) / 1000), 100);
    return () => clearInterval(tick);
  }, [startedAt]);

  return <AIAgentLanes answer={answer} elapsed={elapsed} lanes={lanes} task="Why do we hit the rate limit?" />;
}

With the AI SDK, each sub-agent is usually a tool call: open a step when its part reaches input-available and close it at output-available, using the seconds since the run began.

Here it's fed a run second by second:

PROSlash Command Menu and more like it are in Kokonut UI Pro

Installation

AI Agent Lanes is a free, open-source React component in the Kokonut UI AI collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/ai-agent-lanes.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/ai-agent-lanes

Or add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/ai-agent-lanes.tsx.

npm install lucide-react motion

Props

task
stringDefault "Where should our 30-person team meet for a May…
lanes
AgentLane[]Default demo data

The first lane is the lead; the others are sub-agents it starts.

answer
stringDefault demo data

The lead's final answer. Played back, it types out as the lead's last step runs; live, it shows as you pass it, so stream it straight in.

elapsed
number

Seconds since the run started, from your own clock. Pass it to draw a run as it happens; leave it out and the lanes play back on their own.

className
string

Extra classes for the root element.

AgentLane

idrequired
string
namerequired
string
stepsrequired
AgentStep[]
summary
string

One line the sub-agent hands back to the lead.

AgentStep

toolrequired
ToolKind
labelrequired
string
startrequired
number

Seconds from the start of the run.

end
number

Leave it out while the step is still running.

result
string

What came back, shown once the step is done.

ToolKind

type ToolKind = "think" | "search" | "read" | "write";

Dependencies

NeedsVersionComes from
lucide-react^0.556.0npm, installed by the CLI
motion^12.23.25npm, installed by the CLI
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.