Skip to content

Image crop

Pro

Frames a photo before upload: drag, pinch or zoom it behind a fixed frame, and get the crop in the original pixels. Not an M3 component (@windmorph/react-pro).

import { ImageCropDialog, ImageCropper } from '@windmorph/react-pro';

Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.

Playground

Code

import { useState } from 'react';import { Button } from '@windmorph/react';import { ImageCropDialog } from '@windmorph/react-pro'; export function Example() {  const [open, setOpen] = useState(false);   return (    <>      <Button variant="tonal" onPress={() => setOpen(true)}>        Crop the photo      </Button>      <ImageCropDialog        src="/photos/landscape.jpg"        guide="circle"        open={open}        onOpenChange={setOpen}        onConfirm={(result) => {          console.log(result.crop);          setOpen(false);        }}      />    </>  );}

Examples

A profile photo

Inline, in a 4:5 frame