Vlad Vovk

AI Prompt Input

AI chats 151

About

Premium AI prompt composer with rotating placeholders, floating toolbar, and Cursor-style model selector.

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

Code

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

Usage.tsx

"use client"

import * as React from "react"

import {
  AiPromptInput,
  type AiModelSelection,
  type AiPromptSendStatus,
} from "@/components/ui/ai-prompt-input"

// ONLY DEFAULT EXPORT WILL BE TREATED AS A DEMO
export default function DemoOne() {
  const [value, setValue] = React.useState("")
  const [status, setStatus] = React.useState<AiPromptSendStatus>("idle")
  const [modelSelection, setModelSelection] = React.useState<AiModelSelection>({
    id: "opus-4.5",
    effort: "high",
    context: "200K",
    fast: true,
    thinking: false,
  })
  const timersRef = React.useRef<number[]>([])

  React.useEffect(() => {
    const timers = timersRef.current
    return () => {
      for (const id of timers) window.clearTimeout(id)
    }
  }, [])

  const handleSubmit = () => {
    setStatus("loading")
    const successTimer = window.setTimeout(() => {
      setStatus("success")
      const idleTimer = window.setTimeout(() => {
        setStatus("idle")
        setValue("")
      }, 900)
      timersRef.current.push(idleTimer)
    }, 1400)
    timersRef.current.push(successTimer)
  }

  return (
    <div className="flex w-full max-w-xl flex-col items-center justify-center px-2 py-10">
      <AiPromptInput
        value={value}
        onChange={setValue}
        modelSelection={modelSelection}
        onModelSelectionChange={setModelSelection}
        status={status}
        onSubmit={handleSubmit}
      />
    </div>
  )
}

Dependencies

More by Vlad Vovk

View all
  • Waves shaders Homlu UI

    Waves shaders Homlu UI

    111
  • AI Model Select

    AI Model Select

    104
  • GitHub Sky

    GitHub Sky

    95
  • Line Shader Homlu UI

    Line Shader Homlu UI

    52
  • Letter Morph

    Letter Morph

    24
  • Button

    Button

    17
  • Terminal Pikachu

    Terminal Pikachu

    13
  • Input

    Input

    7

More in AI chats

View all
  • AI Actions

    AI Actions

    351
  • Aquarium Prompt

    Aquarium Prompt

    113
  • Agent Chat

    Agent Chat

    21
  • Message With Header And Delivery Status

    Message With Header And Delivery Status

    60
  • Research Report

    Research Report

    7
  • Tool Web Fetch

    Tool Web Fetch

    4
  • Color Picker

    Color Picker

    201
  • Suggestions

    Suggestions

    40

Explore more

Part of Motoko UI — browse the full library on 21st.dev.