Add a profile picture cropper to your Vue app that enforces a square aspect ratio before the user uploads an image.
Let users select and export a specific region of an uploaded photo as a PNG or JPEG in a Vue project.
Embed an image cropper in a Vue 3 form with real-time preview and rotation controls.
The author recommends the companion library cropper-next-vue for Vue 3 projects needing high-resolution export or advanced rotation.
vue-cropper is a Vue component for adding image cropping functionality to websites. It supports both Vue 2 and Vue 3. The plugin adds an interactive cropping interface to a page: a user loads a photo, drags a selection box over the area they want to keep, and the plugin exports just that cropped portion as a new image. The component has many configuration options. You can control whether the crop box uses a fixed aspect ratio (useful for profile pictures that need to be square), whether the user can scale the image with the scroll wheel, what file format the cropped result exports to (JPEG, PNG, or WebP), and what quality level to use. The crop box can be constrained to stay within the image boundaries or allowed to move freely. A real-time preview feature shows what the final crop will look like as the user adjusts the selection. Installation is via npm with a single command, or the component can be loaded via a CDN link for projects that do not use a build tool. Placing it in a Vue template requires passing the image URL and output options as properties, and the component exposes methods to trigger cropping programmatically, rotate the image left or right, or clear the current selection. The README is written primarily in Chinese and links to an English version. The project also mentions a newer companion library called cropper-next-vue, which the author recommends for Vue 3 projects that need additional features like high-resolution export and real-time preview with rotation boundary detection.
← xyxiao001 on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.