Arihant jain

Prompt Composer

AI chats 17

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

    697
  • Animated Drawer

    Animated Drawer

    686
  • Status Badge

    Status Badge

    494
  • Stacked Circular Footer

    Stacked Circular Footer

    413
  • Input Modal

    Input Modal

    313
  • Large Name Footer

    Large Name Footer

    193
  • Profile Dropdown

    Profile Dropdown

    186

More in AI chats

View all
  • AI Actions

    AI Actions

    319
  • Agent Chat

    Agent Chat

    17
  • System Message

    System Message

    53
  • Message Thread

    Message Thread

    35
  • Color Picker

    Color Picker

    81
  • AI Task List

    AI Task List

    159
  • Quota Banner

    Quota Banner

    21
  • Code Block

    Code Block

    8