UploadKit
SDK@uploadkitdev/react

UploadButtonGradient

An Instagram/TikTok-style button with a continuously rotating conic gradient border ring.

A button wrapped in a spinning conic gradient — orange, pink, and purple hues rotate continuously around the border. The inner surface is dark, letting the gradient bleed through on hover. During upload the rotation accelerates.

Design inspiration: Instagram stories ring, TikTok UI, Figma gradient buttons.

motion is an optional peerDependency. Without it, the rotation uses CSS @keyframes. pnpm add motion for smoother rotation speed transitions between states.

Instagram · TikTok — rotating gradient ring

Basic usage

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

export default function Page() {
  return (
    <UploadButtonGradient
      route="imageUploader"
      accept={['image/*']}
      maxSize={10 * 1024 * 1024}
      onUploadComplete={(result) => {
        console.log('Uploaded:', result.url);
      }}
    >
      Share file
    </UploadButtonGradient>
  );
}

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.
disabledbooleanfalseDisables the button.
classNamestringAdditional CSS class(es).
childrenReactNode'Upload file'Button label.

UploadButtonGradient accepts a ref forwarded to the <button>.

Theming

VariableDefaultPurpose
--uk-gradient-from#f97316First gradient stop (orange)
--uk-gradient-via#ec4899Middle gradient stop (pink)
--uk-gradient-to#8b5cf6Last gradient stop (purple)
--uk-bg#0a0a0bInner button surface
--uk-text#fafafaLabel color
{/* Blue-to-teal variant */}
<div style={{ '--uk-gradient-from': '#3b82f6', '--uk-gradient-via': '#06b6d4', '--uk-gradient-to': '#10b981' } as React.CSSProperties}>
  <UploadButtonGradient route="imageUploader" />
</div>

Accessibility

  • Native <button> element with aria-busy during upload
  • Gradient pseudo-element is purely decorative
  • Respects prefers-reduced-motion — rotation animation pauses

On this page