BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/trovecn/prompt-composer

Prompt Composer

trovecn/prompt-composer
FreeComponent

A focused multiline prompt surface with attachment and model menus plus an explicit send/stop lifecycle.

Install it

npx shadcn@latest add https://trovecn.dev/r/prompt-composer.json

Source

src/components/trovecn/ai-workbench/prompt-composer.tsxtrovecn.dev/r/prompt-composer.json · first 6 KB
1"use client";
2
3import { useEffect, useId, useRef, useState, type FormEvent, type KeyboardEvent } from "react";
4import {
5 ArrowUpIcon,
6 ChevronDownIcon,
7 ClockIcon,
8 FileIcon,
9 FileTextIcon,
10 ImageIcon,
11 ListPlusIcon,
12 PlusIcon,
13 SquareIcon,
14 XIcon,
15} from "lucide-react";
16import { AnimatePresence, motion, Reorder, useReducedMotion } from "motion/react";
17
18import { Button } from "@/components/ui/button";
19import {
20 Menu,
21 MenuContent,
22 MenuItem,
23 MenuRadioGroup,
24 MenuRadioItem,
25 MenuTrigger,
26} from "@/components/ui/menu";
27import { cn } from "@/lib/utils";
28import { spring } from "@/lib/springs";
29
30export interface PromptComposerSubmitEvent {
31 prompt: string;
32}
33
34export interface PromptComposerAttachmentOption {
35 id: string;
36 label: string;
37 description?: string;
38 kind?: "file" | "image" | "folder";
39}
40
41export type PromptComposerFileKind = "image" | "file";
42
43export interface PromptComposerFile {
44 id: string;
45 name: string;
46 kind?: PromptComposerFileKind;
47 /** Object URL or remote URL rendered inside the preview tile for image files. */
48 previewUrl?: string;
49}
50
51export interface PromptComposerQueuedMessage {
52 id: string;
53 prompt: string;
54}
55
56export interface PromptComposerProps {
57 /** Controlled draft text. */
58 value?: string;
59 /** Initial draft text when the component is uncontrolled. */
60 defaultValue?: string;
61 onValueChange?: (value: string) => void;
62 onSubmit?: (event: PromptComposerSubmitEvent) => void;
63 /** Called while a response is being generated. */
64 onStop?: () => void;
65 /** Replaces Send with Stop and prevents edits until the response ends. */
66 isRunning?: boolean;
67 disabled?: boolean;
68 placeholder?: string;
69 /** Limits the number of characters in the draft. */
70 maxLength?: number;
71 /** Optional model choices, rendered as a compact footer menu. */
72 models?: readonly string[];
73 model?: string;
74 onModelChange?: (model: string) => void;
75 /** Choices opened by the attachment menu above the composer. */
76 attachmentOptions?: readonly PromptComposerAttachmentOption[];
77 onAttachmentOptionSelect?: (option: PromptComposerAttachmentOption) => void;
78 /** Attachments for the current draft, shown as preview tiles above the textarea. */
79 files?: readonly PromptComposerFile[];
80 onFilesChange?: (files: readonly PromptComposerFile[]) => void;
81 /** Side length, in pixels, of each file preview tile. */
82 filePreviewSize?: number;
83 /**
84 * Messages waiting to send while a response is running. Providing this
85// … truncated

What it pulls in

npm packages

  • lucide-react
  • @base-ui/react
  • class-variance-authority
  • motion

Other registry items

  • utils
  • button
  • menu
  • springs

Files it writes

  • src/components/trovecn/ai-workbench/prompt-composer.tsx

Facts

Registry
trovecn
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-14
Last confirmed
yesterday

Go to the source

trovecn.dev PPRAMANIK62/trovecn on GitHub Raw registry item This item as JSON

More from trovecn

All 26 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
AccordionaccordiontrovecnComponentsFree3 deps
Agent Activityagent-activitytrovecnComponentsFree2 deps
Approval Requestapproval-requesttrovecnComponentsFree2 deps
ButtonbuttontrovecnComponentsFree2 deps
CheckboxcheckboxtrovecnComponentsFree2 deps
Checkbox Groupcheckbox-grouptrovecnComponentsFree2 deps
ComboboxcomboboxtrovecnComponentsFree3 deps
Comparison Slidercomparison-slidertrovecnComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex