Use the following composition to build an ImageCropper:
This component was inspired by sujjeee/shadcn-image-cropper.
The root component for the image cropper. Handles image upload, cropping, and state management.
Dialog wrapper for the image cropper. Forwards all props and behavior to the shadcn-svelte Dialog component.
The cropper area for selecting the crop region. Forwards all props and behavior to svelte-easy-crop.
Container for cropper controls.
| Prop | Type | Default |
|---|---|---|
ref? $bindable | HTMLDivElement | null |
children? | Snippet | - |
The trigger for uploading an image.
| Prop | Type | Default |
|---|---|---|
ref? $bindable | HTMLLabelElement | null |
children? | Snippet | - |