Serafim

Tool Group

AI chats 99

About

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.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Tool Group to your project and fits it to your theme.

Code

How Tool Group is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

import { ToolGroup } from "@/components/ui/tool-group";

const nestedTools = [
  { category: "file" as const, title: "Read", subtitle: "src/app/layout.tsx" },
  {
    category: "search" as const,
    title: "Grep",
    subtitle: "useChat",
  },
  { category: "file" as const, title: "Read", subtitle: "src/app/page.tsx" },
  {
    category: "search" as const,
    title: "WebSearch",
    subtitle: "ai sdk v6",
  },
  {
    category: "file" as const,
    title: "Read",
    subtitle: "src/components/chat.tsx",
  },
  {
    category: "search" as const,
    title: "Grep",
    subtitle: "<Message",
  },
  {
    category: "file" as const,
    title: "Read",
    subtitle: "src/components/message.tsx",
  },
  {
    category: "file" as const,
    title: "Read",
    subtitle: "src/components/composer.tsx",
  },
  {
    category: "search" as const,
    title: "Grep",
    subtitle: "tool-",
  },
  {
    category: "search" as const,
    title: "Glob",
    subtitle: "src/**/*.tsx",
  },
  {
    category: "file" as const,
    title: "Read",
    subtitle: "src/lib/tools.ts",
  },
  {
    category: "file" as const,
    title: "Read",
    subtitle: "src/lib/agent.ts",
  },
];

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="pending"
          nestedTools={nestedTools}
          completeLabel="Explored"
          shimmerLabel="Exploring"
          interruptedLabel="Exploration interrupted"
          maxVisibleTools={5}
          defaultOpen
        />
      </div>
    </div>
  );
}

Dependencies

More by Serafim

View all
  • Spline Scene

    Spline Scene

    9.5K
  • Testimonials with Marquee

    Testimonials with Marquee

    2.3K
  • Gradient Button

    Gradient Button

    1.9K
  • Pixel Canvas

    Pixel Canvas

    900
  • Animated Blur Number

    Animated Blur Number

    830
  • Empty State

    Empty State

    775
  • Balloons

    Balloons

    755
  • Status Badge

    Status Badge

    646

More in AI chats

View all
  • AI Actions

    AI Actions

    319
  • Agent Chat

    Agent Chat

    17
  • System Message

    System Message

    54
  • Message Thread

    Message Thread

    35
  • Color Picker

    Color Picker

    81
  • AI Task List

    AI Task List

    160
  • Modal Card

    Modal Card

    101
  • Quota Banner

    Quota Banner

    21