About
A file-attachment card showing a thumbnail or icon with a filename, description and status (idle, uploading, processing, error, done), with optional action buttons and a horizontally scrollable group variant.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Attachment to your project and fits it to your theme.
Code
How Attachment is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import {
Attachment,
AttachmentContent,
AttachmentDescription,
AttachmentMedia,
AttachmentTitle,
} from "@/components/ui/attachment";
import { FileText } from "lucide-react";
export default function Demo() {
return (
<div className="flex flex-col gap-3 p-6">
{(["done", "uploading", "error"] as const).map((state) => (
<Attachment key={state} state={state}>
<AttachmentMedia>
<FileText />
</AttachmentMedia>
<AttachmentContent>
<AttachmentTitle>report.pdf</AttachmentTitle>
<AttachmentDescription>{state}</AttachmentDescription>
</AttachmentContent>
</Attachment>
))}
</div>
);
}









