← Prompt Lab

Conic Shimmer Prompt Bar

Rotating Conic-Gradient AI Input with Thinking State
SaaS & AI · Buttons & CTAs3.1 KB0 copies
SHARE
13 / PLAYGROUNDConic Shimmer Prompt Bar
BRAND COLORS
Fullscreen ↗

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.

AI InputConic BorderCSS @property3.1 KB
'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>
  )
}

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

UI SLOTButtons & Inputs
BEST USE CASEAI App Hero Search Box, Copilot Chat Input & Command Palette
IDEAL PLACEMENTHero Interactive Demo or Main App Prompt Composer
BUNDLE SIZE3.1 KB
DEPENDENCIESZero (CSS @property)
MOBILE / TOUCHFull Mobile Keyboard
GPU WEIGHTLight · 60fps