Shehryar Ali

Chat Composer

AI chats

About

Tabbed agent chat panel: a user prompt, step-by-step agent replies that stream in with their data source and duration, and a composer with keyboard send. All content comes through props; follows shadcn theme tokens in light and dark.

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

Code

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

Usage.tsx

import ChatComposer, { type ChatComposerMessage } from "@/components/ui/chat-composer";

/* all content lives here; the component only renders what it is given */

const MESSAGES: ChatComposerMessage[] = [
  {
    label: "Queried",
    source: "Billing events",
    duration: "4s",
    body: "Pulled 90 days of subscription renewals across all plans.",
  },
  {
    label: "Compared",
    source: "Churn cohorts",
    duration: "2s",
    body: "Annual plans churn 3.1% vs 8.4% monthly, mostly in week one.",
  },
];

export default function ChatComposerDemo() {
  return (
    <div className="flex min-h-[520px] w-full items-center justify-center bg-background p-8">
      <ChatComposer
        tabs={["Revenue", "Customers"]}
        initialPrompt="Why did churn spike last quarter?"
        messages={MESSAGES}
        placeholder="Ask about a metric or tag a dataset with @"
        onSend={(text) => console.log("send:", text)}
      />
    </div>
  );
}

More by Shehryar Ali

View all
  • Loading State

    Loading State

    19
  • Insight Cards

    Insight Cards

    9
  • Streaming Text

    Streaming Text

    9
  • Murmur Ember Silk

    Murmur Ember Silk

    3
  • Murmur Ember Tide

    Murmur Ember Tide

    1
  • Granite Sky Aurora

    Granite Sky Aurora

    1
  • Prompt Bar

    Prompt Bar

    1
  • Records Table

    Records Table

More in AI chats

View all
  • Agent Chat

    Agent Chat

    21
  • AI Actions

    AI Actions

    372
  • AI Suggestions

    AI Suggestions

    27
  • Interactive LLM Token & Context Window Visualizer

    Interactive LLM Token & Context Window Visualizer

    30
  • AI SaaS Workflow Hero

    AI SaaS Workflow Hero

    36
  • Aquarium Prompt

    Aquarium Prompt

    219
  • Message Parts

    Message Parts

    10
  • AI Chat Composer

    AI Chat Composer

    21