UploadKit
SDK@uploadkitdev/react

UploadParticles

A constellation of particles that converge to the center as upload progress advances.

A pure-CSS particle field where N randomly-scattered dots smoothly converge toward the center as upload progress advances. No canvas, no WebGL — just transform: translate(...) with a single CSS custom property (--uk-progress) driving the interpolation.

Design inspiration: Stripe 3D Secure loading, Vercel Ship 2023 hero.

motion is not required — particles animate via CSS transform transitions tied to a --uk-progress custom property set inline. Install motion only to extend with spring transitions.

Drop to upload

Stripe 3DS · Vercel Ship — particle convergence

Basic usage

import { UploadParticles } from '@uploadkitdev/react';

export default function Page() {
  return (
    <UploadParticles
      route="avatarUploader"
      accept={['image/*']}
      particleCount={60}
      onUploadComplete={(results) => {
        console.log('Uploaded:', results.length);
      }}
    />
  );
}

Props

PropTypeDefaultDescription
routestringRequired. Route name from your file router.
acceptstring[]Accepted MIME types.
maxSizenumberMaximum file size in bytes.
maxFilesnumberMaximum number of files per drop or selection.
metadataRecord<string, unknown>JSON-serializable metadata forwarded to the server.
particleCountnumber40Number of particles in the constellation.
onUploadComplete(results: UploadResult[]) => voidCalled when every accepted file has uploaded.
onUploadError(error: Error) => voidCalled once per failed file.
classNamestringAdditional CSS class(es) merged onto the outer wrapper.

Theming

VariablePurpose
--uk-particle-colorParticle fill color
--uk-primaryFocus outline
--uk-borderOuter ring border

Accessibility

  • Outer container is role="progressbar" with the aggregate progress as aria-valuenow
  • Particles are decorative (aria-hidden inside the canvas)
  • Focusable via keyboard; Enter and Space open the file picker
  • Respects prefers-reduced-motion — particle transitions collapse to 0.01ms

On this page