Loading
Loading
Loading
mobile footer

Build the Interaction Layer Your Website is Missing.

Browse All EffectsBrowse All EffectsBrowse All EffectsUpgrade to ProUpgrade to ProUpgrade to Pro

80+ effects free, forever. No credit card.

© 2026 Hyperiux. All Rights Reserved.

AI Component CatalogueHey AI, Learn About Us
Platform

Vault

  • Documentation
  • Pricing
  • Blog
  • Community
  • NPM
  • MCP

Categories

  • All Effects
  • WebGL
  • Text
  • Backgrounds
  • Buttons
  • Carousels
  • Scroll
  • Components
  • Navigation
  • Cursor
  • Transitions
  • Loaders

Documents

  • Introduction
  • Installation
  • CLI
  • Dependencies
  • License

Legal

  • License Agreement
  • Terms of Service
  • Privacy Policy
  • Refund Policy
Socials
  • Twitter / X
  • LinkedIn
  • GitHub
  • Instagram
Contact Us
  • hello@hyperiux.com
New effects, in your inbox

Every new drop, plus the occasional behind-the-scenes build. No spam. Unsubscribe anytime.

Loading
Home/Attachment Component

Attachment Component

An animated attachment component with interactive file cards, upload progress, image previews, drag-and-drop reordering, and responsive feedback for file-management workflows.

@base-ui/react@gsap/reactclass-variance-authoritygsaplucide-reactmotiontailwind-merge
DemoDemoDemo

Tune the Real Props

Overview

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.


Theme and Interaction Customisation

Choose image thumbnails, document chips, or note cards, and set groups to wrap or stay in one row. Motion options include animated entry and exit, stagger, fly-in from the drop position, an animated dropzone border, rolling percentages, shimmer text, tracing borders, progress fills, error shake, hover zoom, scroll tilt, and drag reordering.


Example Production Use Case

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.


Best Used For

  • Project submissions with design files, references, and documents.
  • Customer onboarding that tracks required materials.
  • Content management systems organising assets before publishing.
  • Creative review workflows with reorderable image previews.
  • Customer support platforms collecting screenshots, recordings, and logs.
  • Collaboration tools attaching files and notes to tasks.
  • Messaging applications showing file previews in conversations.
  • Document-heavy SaaS products with several uploads per workflow.

Not For

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.


Performance Budget

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.


Accessibility and Mobile

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.


Common Mistakes

  • Treating a local preview as a successful upload.
  • Showing simulated progress as real progress.
  • Losing file identity and state during reordering.
  • Applying progress or image effects outside their supported states.
  • Removing failed attachments automatically instead of offering a retry.
  • Forgetting to clean up temporary preview URLs.
  • Making remove, preview, and retry actions hover-only.
  • Relying only on drag gestures for ordering.
  • Skipping server-side file validation.

Changelog

v1.0.0

Oct 23, 2026
Initial release

API Reference

PropTypeDefaultDescription
themestringvalorantColour palette. The drop zone, border trace and progress take its primary colour.
modestringdarkLight or dark version of the chosen palette.
animateEnterbooleantrueNew files scale up and fade into the list.
staggernumber0.08Gap between files added together, in seconds.
flyInbooleantrueDropped files fly from where they were dropped into the list.
animatedBorderbooleantrueThe drop zone's border marches while a file is dragged over it.
animateExitbooleantrueRemoved files shrink out and the rest slide together.
rollingNumbersbooleantrueUpload percentages roll to each new number.
shimmerTextbooleantrueA light sweeps across the file name while it uploads.
borderTracebooleantrueA line traces around the card as it uploads.
fillbooleantrueImage cards fill up with the picture as they upload.
fillDirectionstringbottom-to-topWhich way the image fill grows. Needs Card fill on.
shakeOnErrorbooleantrueA file that fails shakes: a random failure, or one that is too big or the wrong type.
revealActionbooleantrueThe remove button appears only on hover or focus (pointer devices).
zoomOnHoverbooleantrueImage previews zoom in slightly on hover.
blurUntilLoadedbooleantrueImage previews stay blurred while they upload and process.
expandablebooleantrueClicking an image opens it in a large preview.
reorderbooleantrueDrag files sideways to reorder them.
tiltOnScrollbooleanfalseCards lean as the row is scrolled sideways. Needs Wrap off.
wrapbooleantrueFiles wrap onto new lines instead of scrolling in one row.
simulateFailuresbooleantrueSome uploads fail at random, to preview the error state.
maxSizeMBnumber5Files bigger than this show an error card instead of uploading.
acceptstringanyWhich files can be added. Others show an error card, and the file picker only offers these.

Questions, Answered.

What is Attachment?

Attachment is an animated React component that displays files as interactive cards with image previews, upload progress, error states, and file-management controls, plus grouped attachments and compact note items.

How is Attachment different from a standard file input?

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.

Does Attachment support drag-and-drop uploads?

Yes. Files can be added through a file-selection control or a dropzone, and an animated border shows when the dropzone is ready.

Does Attachment upload files to a server automatically?

No. It provides the file interface and visual states. Transfer, validation, storage, progress reporting, and error recovery need server integration.

Does Attachment support drag-to-reorder?

Yes. Groups support drag reordering, with neighbouring items shifting to make room. Both values and onReorder must be supplied.

Is Attachment accessible?

It can be, with labelled upload controls, keyboard-operable file actions, readable progress and error messages, and an alternative to pointer-only reordering. Verify these in the shipped component.

View MoreView More

Request a Custom Animation

Need a custom effect? Tell us what to create.

Related Effects

Explore All EffectsExplore All EffectsExplore All Effects
Menubar Component
@base-ui/reactlucide-reactmotion

Menubar Component

Components

Button Component
lucide-reactmotiontailwind-merge

Button Component

Components

Drawer Component
@base-ui/reactclass-variance-authoritymotion

Drawer Component

Components

All Effects
Featured ComponentsText AnimationsAnimated BackgroundsAnimated ButtonsCarousel EffectsScroll EffectsCreative ComponentsNavigationsCursor EffectsTransitionsLoadersWebGL & 3D Effects
Templates
IntroductionInstallationCLIDependenciesLicense
PricingBlogGithubNPMMCP Doc