shakeeb

Image Cropper

Forms 59

About

A reusable React image uploader with cropping support for Next.js. Supports drag & drop, file validation, fixed size or aspect ratio cropping. Includes live preview, error handling, and integration-ready callbacks.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Image Cropper to your project and fits it to your theme.

Code

How Image Cropper is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

// this will suport react hook form 

   /* <FormItem>
      <FormLabel>Profile Picture</FormLabel>
       <FormControl>
          <ImageCropper
              aspectRatio={1}
              onChange={field.onChange}
              onBlur={field.onBlur}
              value={field.value}
              error={form.formState.errors.photo?.message}
              className="w-48"
              />
         </FormControl>
        <FormMessage />
      </FormItem> */

// you need to modify the shadcn dialog for modal width 
import { ImageCropper } from "@/components/ui/image-cropper";
export default function DemoOne() {
  return <ImageCropper
  //  aspectRatio={1}
   />;
}

Dependencies

More by shakeeb

View all
  • Preloader

    Preloader

    299
  • Footer

    Footer

    169
  • image uploader

    image uploader

    132

More in Forms

View all
  • Premium Auth

    Premium Auth

    500
  • Login 2

    Login 2

    7
  • Authentication Card

    Authentication Card

    47
  • Login 1

    Login 1

    52
  • Contact Card

    Contact Card

    1K
  • Login Form

    Login Form

    6
  • Form

    Form

    16
  • Book A Demo 3

    Book A Demo 3

    83