Kinetic UI
Back to Introduction
AI & Generative

Chain of Thought Tree

An animated branching tree component that visualizes step-by-step model reasoning, collapsible thought paths, tool calls, and execution times.

Quick Actions
CLI Installation
npx kinetic-ui-cli@latest add reasoning-tree
Reasoning Tree
Chain of Thought

Analyzing request intent

45ms

Extracting entities: 'San Francisco', 'Weather', 'Next 3 days'

Retrieving real-time weather data

850ms

Call weatherAPI(location: 'San Francisco', days: 3)

Parsing JSON response

Formatting final response

12ms

Installation

npx kinetic-ui-cli@latest add reasoning-tree

Usage & Integration

The Reasoning Tree component uses a recursive TreeNode sub-component to render infinitely nestable levels of thought processes.

It pairs beautifully with LLM architectures that emit structured logging (like LangChain callbacks or Vercel AI SDK onToolCall streams). The collapsible nature is powered by framer-motion's AnimatePresence applying height transitions.

Usage Guide

1. Import the Component

Import the component into your React or Next.js page:

import { ReasoningTree } from "@/components/creative/reasoning-tree";

2. Implementation Example

Render the component and customize its behavior by passing props:

import { ReasoningTree } from "@/components/creative/reasoning-tree";

export default function Example() {
  return (
    <div className="w-full flex items-center justify-center p-8">
      <ReasoningTree
        steps{/* value */}
      >
        <div>Content goes here</div>
      </ReasoningTree>
    </div>
  );
}
Performance Notes
  • Uses CSS hardware acceleration via GPU transform-binds.
  • Damped interpolation minimizes paint-redraw flashes.
  • Tree-shakable import: only compiles elements requested.
Accessibility Notes
  • Full keyboard focus-ring navigation support (`Tab`/`Shift+Tab`).
  • ARIA roles mapped correctly for assistive screen readers.
  • Respects `prefers-reduced-motion` system toggles.