
Menubar Component
Components
An animated attachment component with interactive file cards, upload progress, image previews, drag-and-drop reordering, and responsive feedback for file-management workflows.
Attachment shows selected files as cards with thumbnails, file details, upload progress, and contextual actions. New files animate in, progress rolls and shimmers while uploading, and failed uploads shake and offer a retry. Users can reorder items by dragging, open larger previews, and remove files while neighbouring cards slide smoothly into place.
Use it when files are central to a task, such as onboarding, project submissions, design reviews, and support requests, where users need to see what they attached and whether each file is ready.
Attachments come in two kinds, image thumbnails and document cards with a file-type icon, each in its own group that can wrap or stay in one row. Seven themes (default, caffeine, claude, ghibli, spotify, valorant, vscode) in light or dark mode, plus a maximum file size and an accepted-files filter (any, images or documents), set the look and limits. Motion options include animated entry and exit, stagger, fly-in from the drop position, a marching dropzone border while files are dragged over, rolling percentages, shimmer text, tracing borders, image card fills (left to right or bottom to top), blur while uploading, error shake, hover zoom, expandable image previews, scroll tilt, and drag reordering.
An agency onboarding portal can collect brand assets, references, and documents in one place. Clients drag files in, watch each card show its progress, and retry any failure without restarting the whole submission.
A creative review tool can display reference images as thumbnails that reviewers expand, reorder into the sequence they should be discussed, and annotate with short notes.
A support platform can let customers attach screenshots and logs to a ticket, with clear error states when a file is too large or fails to upload.
For a single straightforward file, a native file input is simpler when previews and upload states aren’t needed.
It isn’t a digital asset manager. Large libraries with folders, search, tagging, permissions, and version history need a dedicated system.
A visible card doesn’t mean a file is stored securely, and very large or long transfers may need a dedicated upload manager with pause, resume, and queues.
Keep entrances, hover effects, and layout transitions light, and scope progress updates to the affected card. Avoid decoding full-size images for thumbnails, release preview URLs when they are no longer needed, and stop shimmer, tilt, and tracing once they no longer apply.
Use a labelled file input, name each action’s target (“Remove project-brief.pdf”), and announce progress and errors without reading out every percentage. Hover-revealed actions must work on keyboard focus, and reordering needs a keyboard alternative to dragging. On mobile, keep filenames and controls visible with comfortable tap targets, and with reduced motion simplify entrances, shake, tilt, and zoom.
| Prop | Type | Default | Description |
|---|---|---|---|
theme | string | valorant | Colour palette. The drop zone, border trace and progress take its primary colour. |
mode | string | dark | Light or dark version of the chosen palette. |
animateEnter | boolean | true | New files scale up and fade into the list. |
stagger | number | 0.08 | Gap between files added together, in seconds. |
flyIn | boolean | true | Dropped files fly from where they were dropped into the list. |
animatedBorder | boolean | true | The drop zone's border marches while a file is dragged over it. |
animateExit | boolean | true | Removed files shrink out and the rest slide together. |
rollingNumbers | boolean | true | Upload percentages roll to each new number. |
shimmerText | boolean | true | A light sweeps across the file name while it uploads. |
borderTrace | boolean | true | A line traces around the card as it uploads. |
fill | boolean | true | Image cards fill up with the picture as they upload. |
fillDirection | string | bottom-to-top | Which way the image fill grows. Needs Card fill on. |
shakeOnError | boolean | true | A file that fails shakes: a random failure, or one that is too big or the wrong type. |
revealAction | boolean | true | The remove button appears only on hover or focus (pointer devices). |
zoomOnHover | boolean | true | Image previews zoom in slightly on hover. |
blurUntilLoaded | boolean | true | Image previews stay blurred while they upload and process. |
expandable | boolean | true | Clicking an image opens it in a large preview. |
reorder | boolean | true | Drag files sideways to reorder them. |
tiltOnScroll | boolean | false | Cards lean as the row is scrolled sideways. Needs Wrap off. |
wrap | boolean | true | Files wrap onto new lines instead of scrolling in one row. |
simulateFailures | boolean | true | Some uploads fail at random, to preview the error state. |
maxSizeMB | number | 5 | Files bigger than this show an error card instead of uploading. |
accept | string | any | Which files can be added. Others show an error card, and the file picker only offers these. |
Attachment is an animated React component that displays files as interactive cards with image previews, upload progress, error states, and file-management controls, with documents and images shown in separate reorderable groups.
A native file input only selects files. Attachment adds a visual collection where users inspect files, monitor progress, handle errors, preview images, and reorder items.
Yes. Files can be added through the Add files control or by dropping them on the dropzone, and an animated marching border appears while files are dragged over it.
No. The ready-made component simulates progress, processing and occasional failures locally so the states can be previewed, and checks size and type in the browser. Real transfer, server-side validation, storage, true progress reporting and error recovery need your own upload integration.
Yes. Groups support drag reordering, with neighbouring items shifting to make room. The shipped component wires this up itself, and the reorder prop turns it off. If you compose your own AttachmentGroup, pass both values and onReorder to enable it.
When prefers-reduced-motion is on, Motion transforms and layout animations land instantly, the fly-in, error shake and scroll tilt are skipped, hover zoom and shimmer are turned off, and the border trace is hidden. The same actions and status information remain.
Need a custom effect? Tell us what to create.