UploadKit
SDK@uploadkitdev/react

UploadStepWizard

A 5-stage single-file upload wizard — select, preview, confirm, upload, done.

A guided, 5-stage upload flow for cases where the upload is important and the user should deliberately commit. The five stages are:

  1. Select — click to open the file picker.
  2. Preview — thumbnail, filename, size, with Back / Next.
  3. Confirm — final confirmation step (Cancel / Confirm).
  4. Upload — live progress bar.
  5. Done — success check with "Upload another".

Design inspiration: Stripe Checkout, Apple Pay "Add card" sheet.

motion is an optional peerDependency. Without it, panels use a CSS uk-stepwizard-slide-in keyframe for the enter animation (no exit animation). pnpm add motion for AnimatePresence-driven enter/exit transitions.

Pick a file

Start by selecting something to upload.

Stripe Checkout · Apple Pay — guided wizard

Basic usage

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

export default function Page() {
  return (
    <UploadStepWizard
      route="documentUploader"
      accept={['application/pdf']}
      maxSize={20 * 1024 * 1024}
      onUploadComplete={(result) => {
        console.log('Uploaded:', result.url);
      }}
    />
  );
}

Props

PropTypeDefaultDescription
routestringRequired. Route name from your file router.
acceptstring[]Accepted MIME types.
maxSizenumberMaximum file size in bytes.
metadataRecord<string, unknown>JSON-serializable metadata forwarded to the server.
onUploadComplete(result: UploadResult) => voidCalled after a successful upload.
onUploadError(error: Error) => voidCalled on upload failure.
classNamestringAdditional CSS class(es) merged onto the outer wrapper.

Behavior

  • Object URLs created for image previews are revoked on unmount and on every stage reset.
  • The 'done' stage's "Upload another" button resets the wizard to the 'select' stage.
  • Non-image files show a blank thumbnail placeholder.

Theming

VariablePurpose
--uk-stepwizard-accentDot and primary button color (defaults to --uk-primary)
--uk-progress-track, --uk-progress-fillInline progress bar during the upload stage
--uk-successCompleted dot color and check icon
--uk-bg, --uk-bg-secondary, --uk-border, --uk-textPanel chrome

Accessibility

  • Outer container is role="region" with aria-label="Upload wizard"
  • Stage container is aria-live="polite" so stage transitions are announced
  • Upload progress bar is role="progressbar" with full ARIA values
  • Respects prefers-reduced-motion — panel transitions collapse to 0.01ms

On this page