{
// if you need the file for a form you can call getFileFromUrl with the cropped url
const file = await getFileFromUrl(url);
console.log(file);
}}
>
Installation
jsrepo add ui/image-cropper
Usage
Square Preview
No Default Image
Custom Trigger
Upload image
{#snippet child({ props })}
{/snippet}
Upload a photo...
(src = '')}>Remove photo
Custom Preview
{#snippet child({ src })}
{/snippet}
Acknowledgements
This component was inspired by sujjeee/shadcn-image-cropper.