Image Upload

A single image picker that starts as a drag and drop zone, then swaps to a large preview with a remove button. Returns an object URL and the File in React.

src/registry/ui/image-upload.tsx/r/image-upload.json

Installation#

bash
npx shadcn@latest add @minidev/image-upload

MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/image-upload.json

Usage#

tsx
import { ImageUpload } from "@/components/ui/image-upload"

export function Example() {
  return (
    <ImageUpload className="max-w-lg" />
  )
}

API reference#

ImageUpload props
PropTypeDefault
valuestring | null-
onChange(url: string | null, file?: File | null) => void-
disabledboolean-
classNamestring-

Dependencies#

npm

lucide-react

Built from

Examples#

All form components

Learn more