Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-attachment-list.json --yes

Attachment list

Pro

The files chosen to send, under a composer or a form field, for React and Tailwind CSS. Part of Goop Pro.

Attach files with the paperclip and watch each bar fill; remove one with its cross, or Tab onto it and press Backspace or Delete. A file named with “fail” stops part way with its sentence; one over 25 MB is refused. Pick a look: the same files as rows under a form field. The upload is a timer (about three seconds a file, no request); nothing is stored and no file leaves the page.

When to use

  • The files chosen to send, under a composer or a form field.
  • Use AttachmentList wherever a person chooses files before sending: in a Composer between the ComposerEditor and the ComposerToolbar, fed from ComposerAttach's onFilesChange; under a Field holding a FileUploadTrigger. A FileUpload with an upload function lists its own rows.

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Attachment list on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-attachment-list.json --yes
PROMPT
Add the Goop Attachment list to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { AttachmentList } from '@/components/ui/goop/attachment-list';
import { Composer, ComposerActions, ComposerAttach, ComposerEditor, ComposerSubmit, ComposerToolbar } from '@/components/ui/goop/composer';
import { useState } from 'react';

function Message({ send }: { send: () => void }) {
  const [files, setFiles] = useState<Parameters<typeof AttachmentList>[0]['files']>([]);
  return (
    <Composer onSubmit={(event) => { event.preventDefault(); send(); }}>
      <ComposerEditor aria-label="Message" placeholder="Write to the team" />
      <AttachmentList files={files} onRemove={(file) => setFiles((all) => all.filter((one) => one !== file))} />
      <ComposerToolbar>
        <ComposerActions>
          <ComposerAttach
            aria-label="Attach files"
            onFilesChange={(chosen) => setFiles((all) => [...all, ...chosen.map(({ name, size, type }) => ({ name, size, type }))])}
          />
          <ComposerSubmit aria-label="Send" />
        </ComposerActions>
      </ComposerToolbar>
    </Composer>
  );
}
  • Fits: chat, inbox: field.
  • Also known as: Attachments, AttachmentChips, FileList, FileChips, UploadList.
  • height, width, padding, gap, corner, background, text: add no class for these.

API reference

Options
OptionTypeWhat it does
filesreadonly AttachmentFile[]The chosen files, in their order: one chip or row each.
onRemove?(file: AttachmentFile, index: number) => voidCalled by a file's Remove button, or Backspace or Delete on the file, with the file and its place in files: take it out of your list.
variant?'chips' | 'list' = 'chips'chips a wrapping row of chips, under a composer; list full-width rows, under a form field.
aria-label?string = 'Attachments'The list's name for a screen reader.
  • Types: AttachmentFile = { id?: string; name: string; size?: number; type?: string; progress?: number; error?: ReactNode }
  • data-slot values (to select a part by): attachment-list, attachment-list-content, attachment-list-error, attachment-list-item, attachment-list-item-close, attachment-list-item-content, attachment-list-item-icon, attachment-list-item-label, attachment-list-item-text, attachment-list-status

Keyboard

KeyWhat it does
TabMove to the next file (each file is one tab stop; its Remove is the pointer's)
BackspaceRemove the focused file; the focus moves to the next file, else the previous one, else the control before the list
DeleteRemove the focused file, as Backspace

Accessibility

  • The part itself answers the keys above.
  • hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
invalidthe attribute data-invalid

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/meadow/components/attachment-list.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-attachment-list.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.