BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/prompt-kit/prompt-input

Prompt Input

prompt-kit-agents-ui/prompt-input
FreeComponent

An input field designed for chat interfaces, allowing users to enter and submit text prompts to an AI model

Install it

npx shadcn@latest add https://raw.githubusercontent.com/agents-ui/agents-kit/main/public/c/prompt-input.json

Source

prompt-input.tsxraw.githubusercontent.com/agents-ui/agents-kit/main/public/c/prompt-input.json
1"use client"
2
3import { Textarea } from "@/components/ui/textarea"
4import {
5 Tooltip,
6 TooltipContent,
7 TooltipProvider,
8 TooltipTrigger,
9} from "@/components/ui/tooltip"
10import { cn } from "@/lib/utils"
11import React, {
12 createContext,
13 useContext,
14 useEffect,
15 useRef,
16 useState,
17} from "react"
18
19type PromptInputContextType = {
20 isLoading: boolean
21 value: string
22 setValue: (value: string) => void
23 maxHeight: number | string
24 onSubmit?: () => void
25 disabled?: boolean
26}
27
28const PromptInputContext = createContext<PromptInputContextType>({
29 isLoading: false,
30 value: "",
31 setValue: () => {},
32 maxHeight: 240,
33 onSubmit: undefined,
34 disabled: false,
35})
36
37function usePromptInput() {
38 const context = useContext(PromptInputContext)
39 if (!context) {
40 throw new Error("usePromptInput must be used within a PromptInput")
41 }
42 return context
43}
44
45type PromptInputProps = {
46 isLoading?: boolean
47 value?: string
48 onValueChange?: (value: string) => void
49 maxHeight?: number | string
50 onSubmit?: () => void
51 children: React.ReactNode
52 className?: string
53}
54
55function PromptInput({
56 className,
57 isLoading = false,
58 maxHeight = 240,
59 value,
60 onValueChange,
61 onSubmit,
62 children,
63}: PromptInputProps) {
64 const [internalValue, setInternalValue] = useState(value || "")
65
66 const handleChange = (newValue: string) => {
67 setInternalValue(newValue)
68 onValueChange?.(newValue)
69 }
70
71 return (
72 <TooltipProvider>
73 <PromptInputContext.Provider
74 value={{
75 isLoading,
76 value: value ?? internalValue,
77 setValue: onValueChange ?? handleChange,
78 maxHeight,
79 onSubmit,
80 }}
81 >
82 <div
83 className={cn(
84 "border-input bg-background rounded-3xl border p-2 shadow-xs",
85 className
86 )}
87 >
88 {children}
89 </div>
90 </PromptInputContext.Provider>
91 </TooltipProvider>
92 )
93}
94
95export type PromptInputTextareaProps = {
96 disableAutosize?: boolean
97} & React.ComponentProps<typeof Textarea>
98
99function PromptInputTextarea({
100 className,
101 onKeyDown,
102 disableAutosize = false,
103 ...props
104}: PromptInputTextareaProps) {
105 const { value, setValue, maxHeight, onSubmit, disabled } = usePromptInput()
106 const textareaRef = useRef<HTMLTextAreaElement>(null)
107
108 useEffect(() => {
109 if (disableAutosize) return
110
111 if (!textareaRef.current) return
112 textareaRef.current.style.height = "auto"
113 textareaRef.current.style.height =
114// … truncated

What it pulls in

Other registry items

  • textarea
  • tooltip

Files it writes

  • components/prompt-kit/prompt-input.tsx

Facts

Registry
prompt-kit
Type
registry:ui
Access
Free
Files written
1
Licence
NOASSERTION
In the index
at or before 2026-08-07
Last confirmed
3 days ago

Go to the source

agents-ui.github.io agents-ui/agents-kit on GitHub Raw registry item This item as JSON

More from prompt-kit

All 12 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Chat Containerchat-containerprompt-kitComponentsFree1 dep
Code Blockcode-blockprompt-kitComponentsFree1 dep
File Uploadfile-uploadprompt-kitComponentsFreeno deps
Jsx Previewjsx-previewprompt-kitComponentsFree1 dep
Loaderloaderprompt-kitComponentsFreeno deps
Markdownmarkdownprompt-kitComponentsFree4 deps · 2 files
Messagemessageprompt-kitComponentsFree5 deps · 3 files
Prompt Suggestionprompt-suggestionprompt-kitComponentsFree2 deps

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