A sleek AI command input wrapped in a smoothly rotating CSS @property conic-gradient shimmer border that accelerates during Thinking state and streams live token feedback.
'use client'
import { useState } from 'react'
export function ShimmerPromptBar({ onSubmit }: { onSubmit?: (prompt: string) => void }) {
const [value, setValue] = useState('')
const [thinking, setThinking] = useState(false)
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault()
if (!value.trim()) return
setThinking(true)
onSubmit?.(value.trim())
setTimeout(() => setThinking(false), 1200)
}
return (
<div
className="relative rounded-[22px] p-[1.5px] shadow-2xl"
style={{ background: `linear-gradient(120deg, #8b5cf6, #06b6d4, #8b5cf6)` }}
>
<form onSubmit={handleSubmit} className="flex flex-col gap-3 rounded-[20.5px] bg-[#101420] p-4 text-white">
<input
value={value}
onChange={(e) => setValue(e.target.value)}
placeholder="Ask AI to generate a pricing table or SQL query…"
className="w-full bg-transparent text-sm outline-none placeholder:text-slate-500"
/>
<div className="flex items-center justify-between">
<span className="font-mono text-xs text-slate-400">{thinking ? 'Thinking…' : 'Ready'}</span>
<button
type="submit"
style={{ background: `linear-gradient(135deg, #8b5cf6, #06b6d4)` }}
className="rounded-full px-4 py-1.5 text-xs font-semibold text-slate-950"
>
Run Prompt ↵
</button>
</div>
</form>
</div>
)
}Loading single-file HTML…
Create a single-file AI Prompt Input Bar with a rotating conic-gradient shimmer border using pure HTML, CSS @property, and vanilla JS on a dark canvas (#080a10). - Shimmer Border Craft: Register @property --angle as <angle> and animate a 1.5px conic-gradient border (#8b5cf6 to #06b6d4) continuously around a dark rounded input container (#101420), accelerating spin duration from 4.2s (Idle) to 1.2s (Thinking). - Interactive Demo: Include clickable starter prompt chips, an animated status pill (Ready → Thinking → Streaming tokens → Completed), and simulated character-by-character token streaming. - Production Ready: Zero dependencies, keyboard submit support, mobile responsive, and prefers-reduced-motion fallback.
WHY THIS WORKS IN PRODUCTION
- Smooth GPU-accelerated CSS @property rotating conic-gradient border
- Live state transitions: Ready → Thinking (fast spin) → Streaming tokens
- Drop-in React + Tailwind TSX snippet ready for real AI chat apps
- Zero external libraries, keyboard accessible & mobile-ready
DROP-IN SPECS // WEB & MOBILE FIT









