Skip to Content
Kokonut UI

AI-01AIUpdated, November 16, 2026

AI Input Selector

AI chat input with a model menu, a separate Effort control, file chips you can drop or paste, a / command menu, and Stop while replying.

Install with
lucide-react, motion

PROWant commands in the prompt? Slash Command Menu is in Kokonut UI Pro

Installation

AI Input Selector is a free, open-source React component in the Kokonut UI AI collection. Add it with the shadcn CLI, which copies the source into components/kokonutui/ai-prompt.tsx, so the code is yours to change.

npx shadcn@latest add @kokonutui/ai-prompt

Or add it by hand: install its packages, then copy the source from Copy code above into components/kokonutui/ai-prompt.tsx.

npm install lucide-react motion

Usage

import AI_Prompt from "@/components/kokonutui/ai-prompt";

export default function Example() {
  return <AI_Prompt />;
}

Props

models
PromptModel[]Default built-in
defaultModel
stringDefault "Claude Opus 5.5"

Name of the model selected at first.

placeholder
stringDefault "Ask anything. Type / for commands"
headerText
stringDefault "Claude Fable 5.1 is free this weekend"

One line above the box, e.g. a promo. Pass "" to hide the header.

headerAction
stringDefault "Try it"

Label of the header button, which switches to promotedModel.

promotedModel
stringDefault "Claude Fable 5.1"

The model the header talks about; its icon leads the header.

onSubmit
(value: string, model: string, options: { /** The effort level, or null for a model without one. */ effort: string | null; files: File[]; signal: AbortSignal; command: PromptCommand | null }) => unknown

Sends the message. Return a promise to show the Stop button until it settles; signal aborts when the user presses Stop. Without it, the component plays a short pretend reply so the demo feels alive.

commands
PromptCommand[]Default built-in

Shown when the message starts with "/". Pass [] to turn the menu off.

onStop
() => void

Called when the user presses Stop while a reply is in progress.

onAttach
(files: FileList | File[]) => void

Called with the files picked, dropped or pasted into the prompt.

className
string

Extra classes for the root element.

PromptModel

namerequired
string
description
string

One line under the name in the menu.

efforts
string[]

Effort levels, lowest first, e.g. ["Low", "Medium", "High"]. Leave out for a model without a thinking control: the Effort button hides.

defaultEffort
string

Effort to start on when the model is picked fresh.

PromptCommand

idrequired
string
labelrequired
string
description
string
icon
ReactNode

Dependencies

NeedsVersionComes from
lucide-react^0.556.0npm, installed by the CLI
motion^12.23.25npm, installed by the CLI
textareashadcn/ui, added by the CLI
dropdown-menushadcn/ui, added by the CLI
hooks/use-auto-resize-textarea.tsKokonut UI, copied by the CLI
cn from lib/utils.tsshadcn init
React19Your app
Tailwind CSS4Your app

No provider, font or global CSS to set up: the file works as soon as it lands.