UploadKit
SDK@uploadkitdev/react

UploadProgressRadial

A click-to-upload radial progress ring with a Motion pathLength fill and success splash.

A single-file radial progress component: click the ring, pick a file, watch the stroke fill clockwise as it uploads, and get a subtle splash animation on success. The ring uses Motion's pathLength when the optional peer dep is installed, and falls back to stroke-dashoffset otherwise — both look identical at a glance.

Design inspiration: Linear attachments, Apple Health activity ring.

motion is an optional peerDependency. Without it, the fill animates via stroke-dashoffset. pnpm add motion to swap to Motion's pathLength for a silkier feel.

Upload

Linear · Apple Health — activity ring

Basic usage

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

export default function Page() {
  return (
    <UploadProgressRadial
      route="imageUploader"
      accept={['image/*']}
      maxSize={5 * 1024 * 1024}
      size={140}
      strokeWidth={8}
      label="Upload image"
      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.
sizenumber120Diameter of the ring in pixels.
strokeWidthnumber6Ring stroke width in viewBox units (100).
labelstring'Upload'Idle center label. Replaced by file name while uploading and 'Done' on success.
onUploadComplete(result: UploadResult) => voidCalled after a successful upload.
onUploadError(error: Error) => voidCalled on upload failure.
classNamestringAdditional CSS class(es) merged onto the outer wrapper.

UploadProgressRadial accepts a ref forwarded to the outer <div>.

Theming

UploadProgressRadial reads these CSS custom properties:

VariablePurpose
--uk-progress-trackUnfilled ring color
--uk-progress-fillRing fill color (defaults to --uk-primary)
--uk-text, --uk-text-secondaryLabel colors
--uk-successLabel color on success

Accessibility

  • Outer element is role="button" with a dynamic aria-label
  • Inner label is role="progressbar" with aria-valuemin, aria-valuemax, and aria-valuenow
  • Focusable via keyboard; Enter and Space open the file picker
  • focus-visible outline uses --uk-primary
  • Respects prefers-reduced-motion — ring transitions and splash animation drop to 0.01ms

On this page