Arihant jain

Prompt Composer

AI chats 18

About

A chat prompt input with file attachments, a model picker dropdown, character counter, and a generating/stop state for AI assistant interfaces.

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

Code

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

Usage.tsx

import PromptComposer from "@/components/ui/prompt-composer";

export default function PromptComposerDemo() {
  const models = [
    {
      id: "gpt-4o",
      name: "GPT-4o",
      description: "Great for most tasks",
      badge: "Fast",
    },
    {
      id: "gpt-4o-mini",
      name: "GPT-4o mini",
      description: "Cheaper and faster",
    },
    { id: "o1", name: "o1", description: "Advanced reasoning" },
  ];

  return (
    <div className="flex w-full items-center justify-center p-8">
      <PromptComposer
        placeholder="Ask anything…"
        models={models}
        defaultModelId="gpt-4o"
        onSend={(text, modelId) => console.log("send", text, modelId)}
      />
    </div>
  );
}

Dependencies

More by Arihant jain

View all
  • Footer section

    Footer section

    1.9K
  • Multistep Form

    Multistep Form

    710
  • Animated Drawer

    Animated Drawer

    694
  • Status Badge

    Status Badge

    514
  • Stacked Circular Footer

    Stacked Circular Footer

    426
  • Input Modal

    Input Modal

    329
  • Large Name Footer

    Large Name Footer

    199
  • Profile Dropdown

    Profile Dropdown

    196

More in AI chats

View all
  • AI Actions

    AI Actions

    326
  • Agent Chat

    Agent Chat

    18
  • Message Thread

    Message Thread

    45
  • System Message

    System Message

    58
  • Attachments

    Attachments

    22
  • Color Picker

    Color Picker

    110
  • Environment Variables

    Environment Variables

    14
  • AI Diff

    AI Diff

    74