Components
Chat composer that grows with the text, carries attachment chips, and swaps send for stop while the model streams. Respects prefers-reduced-motion.

"use client";
import { useState } from "react";
import Component from "@/components/ui/ai-prompt-input";
export default function DemoOne() {
const [value, setValue] = useState(
"Rewrite the pricing section so the annual plan reads as the default"
);
return (
<div className="flex min-h-[440px] w-full items-center justify-center bg-background p-10">
<div className="w-full max-w-lg space-y-6">
<Component
attachments={[
{ id: "1", name: "pricing.tsx", size: 4200 },
{ id: "2", name: "brand-guidelines.pdf", size: 182_000 },
]}
maxLength={2000}
onValueChange={setValue}
placeholder="Ask anything…"
state="idle"
value={value}
/>
<Component placeholder="Ask anything…" state="streaming" value="" />
</div>
</div>
);
}