Components
Collapsible header summarizing nested tool calls (files / searches / commands). State-driven (completed / pending streaming / interrupted) with shimmer label and elapsed time. Self-contained port from 21st.dev Agent Elements.
npx shadcn@latest add https://21st.dev/r/21stdev/tool-groupLoading preview...
"use client";
import { ToolGroup } from "@/components/ui/tool-group";
const nestedTools = [
{
category: "command" as const,
title: "Bash",
subtitle: "pnpm lint",
},
{
category: "search" as const,
title: "Grep",
subtitle: "InputBar",
},
{
category: "file" as const,
title: "Read",
subtitle: "/lib/agent-ui/components/input-bar.tsx",
},
];
export default function Demo() {
return (
<div className="min-h-screen w-full flex items-center justify-center p-6 bg-white dark:bg-neutral-950">
<div className="w-full max-w-[420px]">
<ToolGroup
state="completed"
nestedTools={nestedTools}
completeLabel="Task completed"
shimmerLabel="Running task"
interruptedLabel="Task interrupted"
elapsedTime="6s"
defaultOpen={false}
/>
</div>
</div>
);
}