Preet Suthar

AI Chat History

AI chats 2

About

Display and manage conversation history with search and filtering.

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

Code

How AI Chat History is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import AIChatHistory from "@/components/ui/ai-chat-history";

export default function DemoOne() {
  const now = Date.now();
  
  return <AIChatHistory
  conversations={[
    {
      id: "conv-1",
      title: "React Component Patterns",
      lastMessage: "How do I create reusable components?",
      lastMessageAt: new Date(now),
      messageCount: 12,
      isActive: true,
    },
    {
      id: "conv-2",
      title: "TypeScript Best Practices",
      lastMessage: "What are the benefits of using TypeScript?",
      lastMessageAt: new Date(now - 2 * 60 * 60 * 1000),
      messageCount: 8,
    },
    {
      id: "conv-3",
      title: "Deploying to Vercel",
      lastMessage: "How to set up automatic deployments?",
      lastMessageAt: new Date(now - 6 * 60 * 60 * 1000),
      messageCount: 5,
      isArchived: true,
    },
  ]}
  activeConversationId="conv-1"
  onSelect={(id) => {
    /* select conversation logic */
  }}
  onNewConversation={() => {
    /* create new conversation */
  }}
  onRename={async (id, newName) => {
    /* rename logic */
  }}
  onDelete={async (id) => {
    /* delete logic */
  }}
/>;
}

Dependencies

More by Preet Suthar

View all
  • Modern & Stunning sign in

    Modern & Stunning sign in

    1.5K
  • Shining Text

    Shining Text

    1.5K
  • Magic Text

    Magic Text

    846
  • Hero 2

    Hero 2

    818
  • Toolbar

    Toolbar

    815
  • Typewriter Text

    Typewriter Text

    768
  • AI Chat Input

    AI Chat Input

    730
  • Full Screen Signup

    Full Screen Signup

    722

More in AI chats

View all
  • AI Actions

    AI Actions

    317
  • Agent Chat

    Agent Chat

    17
  • Prompt with Model Picker

    Prompt with Model Picker

    2
  • Color Picker

    Color Picker

    73
  • Approval Card

    Approval Card

    12
  • System Message

    System Message

    53
  • Message

    Message

    48
  • Quota Banner

    Quota Banner

    20