Attachments
Files attached to a form or a message, one at a time or in a row.
Horizontal
The description names the state; color and shimmer only echo it.
doneProps of done
<Attachment title="cool-dashboard.pdf" icon="lucide:file-text">
PDF · 2.4 MB
<Button slot="actions" size="icon-sm" variant="ghost" tone="neutral" aria-label="Remove cool-dashboard.pdf"><Icon name="lucide:x" /></Button>
</Attachment>idleProps of idle
<Attachment title="notes.md" icon="lucide:file-text" state="idle">
Ready to upload
<Button slot="actions" size="icon-sm" variant="ghost" tone="neutral" aria-label="Remove notes.md"><Icon name="lucide:x" /></Button>
</Attachment>uploadinganimatedProps of uploading
<Attachment title="cool-report.xlsx" icon="lucide:file-spreadsheet" state="uploading" progress={64}>
Uploading · 64%
<Button slot="actions" size="icon-sm" variant="ghost" tone="neutral" aria-label="Remove cool-report.xlsx"><Icon name="lucide:x" /></Button>
</Attachment>processinganimatedProps of processing
<Attachment title="research-summary.pdf" icon="lucide:file-text" state="processing">Processing document</Attachment>errorProps of error
<Attachment title="recording.mov" state="error">
Failed · File exceeds 100 MB
<Button slot="actions" size="icon-sm" variant="ghost" tone="neutral" aria-label="Retry recording.mov"><Icon name="lucide:rotate-cw" /></Button>
<Button slot="actions" size="icon-sm" variant="ghost" tone="neutral" aria-label="Remove recording.mov"><Icon name="lucide:x" /></Button>
</Attachment>imageProps of image
<Attachment title="greg.jpg" image={image("/_astro/greg.B9OwiVM9.jpg")}>JPG · 184 KB</Attachment>linkProps of link
<Attachment title="test-pattern.jpg" image={image("/_astro/test-pattern.CRwj5U5U.jpg")} href="/_astro/test-pattern.CRwj5U5U.jpg" download>
Click to download
<Button slot="actions" size="icon-sm" variant="ghost" tone="neutral" aria-label="Remove test-pattern.jpg"><Icon name="lucide:x" /></Button>
</Attachment>long-nameProps of long-name
<Attachment title="an-unreasonably-long-file-name-that-will-not-fit-v2-final-FINAL.tar.gz" icon="lucide:file-archive">TAR.GZ · 48.1 MB</Attachment>size-lgProps of size-lg
<Attachment title="main.ts" icon="lucide:file-code" size="lg">
TypeScript · 3 KB
<Button slot="actions" size="icon-sm" variant="ghost" tone="neutral" aria-label="Remove main.ts"><Icon name="lucide:x" /></Button>
</Attachment>size-defaultProps of size-default
<Attachment title="main.ts" icon="lucide:file-code" size="default">
TypeScript · 3 KB
<Button slot="actions" size="icon-sm" variant="ghost" tone="neutral" aria-label="Remove main.ts"><Icon name="lucide:x" /></Button>
</Attachment>size-smProps of size-sm
<Attachment title="main.ts" icon="lucide:file-code" size="sm">
TypeScript · 3 KB
<Button slot="actions" size="icon-sm" variant="ghost" tone="neutral" aria-label="Remove main.ts"><Icon name="lucide:x" /></Button>
</Attachment>Vertical
For image previews: the media stacks above the name.
lgProps of lg
<Attachment title="greg.jpg" image={image("/_astro/greg.B9OwiVM9.jpg")} orientation="vertical" size="lg">
JPG · 184 KB
<Button slot="actions" size="icon-sm" variant="ghost" tone="neutral" aria-label="Remove greg.jpg"><Icon name="lucide:x" /></Button>
</Attachment>defaultProps of default
<Attachment title="greg.jpg" image={image("/_astro/greg.B9OwiVM9.jpg")} orientation="vertical" size="default">
JPG · 184 KB
<Button slot="actions" size="icon-sm" variant="ghost" tone="neutral" aria-label="Remove greg.jpg"><Icon name="lucide:x" /></Button>
</Attachment>smProps of sm
<Attachment title="greg.jpg" image={image("/_astro/greg.B9OwiVM9.jpg")} orientation="vertical" size="sm">
JPG · 184 KB
<Button slot="actions" size="icon-sm" variant="ghost" tone="neutral" aria-label="Remove greg.jpg"><Icon name="lucide:x" /></Button>
</Attachment>iconProps of icon
<Attachment title="slides.key" icon="lucide:presentation" orientation="vertical">Keynote · 12 MB</Attachment>uploadinganimatedProps of uploading
<Attachment title="test-pattern.jpg" image={image("/_astro/test-pattern.CRwj5U5U.jpg")} orientation="vertical" state="uploading" progress={30}>Uploading · 30%</Attachment>Attachment groups
Scrolls sideways and snaps; the overflowing edges fade.
defaultanimatedProps of default
<AttachmentGroup label="Attachments">
<Attachment title="cool-dashboard.pdf" icon="lucide:file-text">
PDF · 2.4 MB
<Button slot="actions" size="icon-sm" variant="ghost" tone="neutral" aria-label="Remove cool-dashboard.pdf"><Icon name="lucide:x" /></Button>
</Attachment>
<Attachment title="greg.jpg" image={image("/_astro/greg.B9OwiVM9.jpg")}>
JPG · 184 KB
<Button slot="actions" size="icon-sm" variant="ghost" tone="neutral" aria-label="Remove greg.jpg"><Icon name="lucide:x" /></Button>
</Attachment>
<Attachment title="cool-report.xlsx" icon="lucide:file-spreadsheet" state="uploading" progress={64}>Uploading · 64%</Attachment>
<Attachment title="recording.mov" state="error">Failed · Too large</Attachment>
<Attachment title="main.ts" icon="lucide:file-code">TypeScript · 3 KB</Attachment>
</AttachmentGroup>verticalProps of vertical
<AttachmentGroup label="Images">
<Attachment title="photo-1.jpg" image={image("/_astro/greg.B9OwiVM9.jpg")} orientation="vertical" size="sm" />
<Attachment title="photo-2.jpg" image={image("/_astro/test-pattern.CRwj5U5U.jpg")} orientation="vertical" size="sm" />
<Attachment title="photo-3.jpg" image={image("/_astro/greg.B9OwiVM9.jpg")} orientation="vertical" size="sm" />
<Attachment title="photo-4.jpg" image={image("/_astro/test-pattern.CRwj5U5U.jpg")} orientation="vertical" size="sm" />
<Attachment title="photo-5.jpg" image={image("/_astro/greg.B9OwiVM9.jpg")} orientation="vertical" size="sm" />
</AttachmentGroup>
