crysta1221

Attachment

Cards 5

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>
  );
}

Dependencies

More by crysta1221

View all
  • M3 Expressive Button

    M3 Expressive Button

    9

More in Cards

View all
  • Course Design Cards

    Course Design Cards

    1.1K
  • Statistics Card 7

    Statistics Card 7

    301
  • Statistics Card 2

    Statistics Card 2

    272
  • Stats cards with links

    Stats cards with links

    82
  • Interactive Tech Stack Bento Grid with Hover Effects

    Interactive Tech Stack Bento Grid with Hover Effects

    184
  • Card Studio

    Card Studio

    35
  • Card

    Card

    70
  • Card

    Card

    18