A file on its way up or already there, with a drop zone and an upload queue.
FreeWeb and MobileMotion
Preview
npx shadcn add @fetaui/attachmentPlayground
Report.pdf
Drop files here
States
ready.pdf
uploading.pdf
processing.pdf
error.pdf
uploaded.pdf
Sizes
Default.png
Small.zip
XSmall.csv
Vertical
Report.pdf
Photo.png
Clip.mp4
File types
Sample file
Sample image
Sample pdf
Sample archive
Sample sheet
Sample code
Sample video
Sample audio
Status
Icons animation
Motion
Installation
Terminal· bash
npx shadcn add @fetaui/attachment
Sizes
Default and small for queues. Extra small drops the status line.
Default.png
Small.zip
XSmall.csv
Status
Motion
Accessibility
- Actions name the file they act on.
- Status is live, and the bar is a progressbar.
- Browse is the keyboard path to the drop zone.
Motion
- Rows grow in on a spring and fold away when removed.
- The tick badge pops on Uploaded, and Error shakes once.
- Processing sweeps a bar on a 1200 ms loop.
- With reduced motion, rows appear and the bar holds still.
Responsive behavior
- 320 px cards on Web and full width on Mobile.
Performance
- Upload rows mount and fold on springs, and exit with no animation when still.
- The spinner and progress bar keep moving with reduced motion, because they are status.
- Update
progressat a modest rate. Each change re-renders the row.
Note for AI
Give your coding assistant the Markdown reference instead of screenshots.
- Import
AttachmentandFileUploadfrom@/components/fetaui/attachment. It composesButtonandIconButton. FileUploadonly reports files throughonFiles. You upload them and passitemsback with status and progress.acceptis a convenience. Check file type and size on the server.hintis plain text and enforces nothing.onRetryshows in the error state only, andonMorein uploaded only. The demo's queue is a timer.
Related
Attachment GroupComponentA scrolling row of files above a composer. It fades where it overflows.ButtonComponentOne family for every action, with a label, optional icons and a shortcut key.Icon ButtonComponentThe round sibling of Button, for an action one icon can explain.Avatar UploadComponentA profile photo with drop, progress, replace and clear errors, or a sample face.