crysta1221

Attachment

Cards 23

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

    21
  • Circular Progress

    Circular Progress

    2
  • Combobox

    Combobox

    2
  • Input OTP

    Input OTP

  • Field

    Field

  • List Item

    List Item

  • Empty

    Empty

More in Cards

View all
  • Stats cards with links

    Stats cards with links

    46
  • Course Design Cards

    Course Design Cards

    1.3K
  • Liquid Glass Card

    Liquid Glass Card

    202
  • Statistics Card 2

    Statistics Card 2

    321
  • Card Studio

    Card Studio

    37
  • Astryx Clickable Card

    Astryx Clickable Card

    1
  • Admin Dashboard Cards

    Admin Dashboard Cards

    40
  • Statistics Card 10

    Statistics Card 10

    307