Origin UI

Image Crop

Component 9

About

Here is Image Crop component

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

Code

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

Usage.tsx

import {
  Cropper,
  CropperCropArea,
  CropperDescription,
  CropperImage,
} from "@/components/ui/image-crop"

export default function Component() {
  return (
    <div className="flex min-h-screen w-full flex-col items-center justify-center gap-4 bg-background p-8">
      <Cropper
        className="h-96 w-full max-w-2xl"
        image="https://cdn.21st.dev/assets/mirror/b9/b9b537c1d33ff1cd7ce3e33839412ef2c06c5cd15096b357098c94acd1c7955b.jpg"
      >
        <CropperDescription />
        <CropperImage />
        <CropperCropArea className="shadow-[0_0_0_9999px_rgba(255,255,255,0.5)]" />
      </Cropper>

      <p
        aria-live="polite"
        role="region"
        className="text-muted-foreground mt-2 text-xs"
      >
        Cropper with custom mask overlay ∙{" "}
        <a
          href="https://github.com/origin-space/image-cropper"
          className="hover:text-foreground underline"
          target="_blank"
        >
          API
        </a>
      </p>
    </div>
  )
}

Dependencies

More by Origin UI

View all
  • Dialog

    Dialog

    1.2K
  • Avatar

    Avatar

    951
  • useImageUpload

    useImageUpload

    926
  • usePagination

    usePagination

    622
  • Popover

    Popover

    384
  • Button

    Button

    361
  • Command

    Command

    320
  • Accordion

    Accordion

    256