Component packs › Hoist › Image Crop
Crop cuts like a paper trimmer: the blade runs the edges and the four offcuts fall away under gravity.
Image Crop is a crop from Hoist, a component pack with 6 file upload components: File upload components where every file is a paper sheet lifted on a steel cable. Price: $2 for the whole pack.
Built with: canvas Blob output, aspect presets, keyboard move and resize.
Code: React and Next.js (TypeScript), Vue 3, plain HTML/CSS/JS, Tailwind CSS v4 and Motion (motion.dev). No npm packages needed. Keyboard accessible, with a reduced-motion version, in dark and light.
| Prop | Type | Default | Description |
|---|---|---|---|
src | string | Santorini (Unsplash) | Image URL (must allow CORS for the canvas output). Default: Santorini (Unsplash). |
alt | string | ||
aspect | number | 1 | Aspect ratio w/h; 0 is free. Default 1. |
width | number | 360 | Width in px. Default 360. |
dark | boolean | ||
onCrop | (result: { blob: Blob | null; x: number; y: number; width: number; height: number }) => void | ||
autoplay | number | false | Showcase mode: moves the frame and crops every N ms while visible. |
crop(): Promise<Blob | null>reset(): voiddestroy(): voidimport ImageCrop from './ImageCrop';
<ImageCrop />The Vue, HTML, Next.js, Tailwind and Motion versions take the same options.
Good for: File upload.