Components
- Accordion
- Action Bar
- Alert Dialog
- Alert
- Announcement
- Aspect Ratio
- Autocomplete
- Avatar
- Badge
- Bottom Navigation
- Breadcrumb
- Button Group
- Button
- Calendar
- Card
- Carousel
- Chart
- Checkbox
- Circular Progress
- Circular Slider
- Clipboard
- Collapsible
- Color Picker
- Combobox
- Command
- Context Menu
- Data List
- Date Picker
- Dialog
- Drawer
- Editable
- Field
- File Upload
- Float
- Floating Panel
- Frame
- Hint
- Hover Card
- Image Cropper
- Input Group
- Input OTP
- Input
- Item
- Kbd
- Link Overlay
- Listbox
- Marquee
- Menu
- Native Select
- Number Input
- Pagination
- Popover
- Progress
- Prose
- QR Code
- Radio Group
- Rating
- Resizable
- Scroll Area
- Segment Group
- Select
- Separator
- Sheet
- Sidebar
- Signature Pad
- Skeleton
- Skip Nav
- Slider
- Spinner
- Status
- Steps
- Switch
- Table
- Tabs
- Textarea
- Timer
- Toast
- Toggle Group
- Toggle Tooltip
- Toggle
- Tooltip
- Tour
- Tree View

Installation
pnpm dlx shadcn@latest add https://shark.vini.one/r/image-cropper.json
Usage
import { ImageCropper, ImageCropperImage, ImageCropperSelection, } from "@/components/ui/image-cropper";
<ImageCropper> <ImageCropperImage alt="Crop me" src="/image.jpg" /> <ImageCropperSelection /> </ImageCropper>
Examples
Aspect ratio
Use the aspectRatio to lock the crop area to a specific aspect ratio.

Circle crop
Use cropShape="circle" for profile pictures or avatars.

Initial crop
Start with a pre-defined crop area using the initialCrop prop.

Controlled zoom
Control zoom programmatically with the zoom and onZoomChange props.

Zoom limits
Set minZoom and maxZoom to constrain how far users can zoom.

Min and max size
Constrain the crop area size with minWidth, minHeight, maxWidth, and maxHeight.

Fixed crop area
Set fixedCropArea to true when the crop area should stay fixed while the image moves underneath.

API Reference
ImageCropper
Root wrapper. Manages crop state and handles.
| Prop | Type | Default |
|---|---|---|
aspectRatio | number | - |
cropShape | 'circle' | 'rectangle' | 'rectangle' |
fixedCropArea | boolean | false |
initialCrop | { x: number; y: number; width: number; height: number } | - |
maxHeight | number | Infinity |
maxWidth | number | Infinity |
maxZoom | number | 5 |
minHeight | number | 40 |
minWidth | number | 40 |
minZoom | number | 1 |
onCropChange | (details: CropChangeDetails) => void | - |
onZoomChange | (details: ZoomChangeDetails) => void | - |
rotation | number | - |
zoom | number | - |
className | string | - |
| Attribute | Default |
|---|---|
--cropper-accent | var(--color-white) |
--cropper-handler-size | --spacing(2) |
--cropper-handler-width | --spacing(1) |
ImageCropperImage
Image to crop. Pass src and alt.
| Prop | Type | Default |
|---|---|---|
alt | string | - |
src | string | - |
className | string | - |
ImageCropperSelection
Crop selection overlay with resize handles and optional grid.
| Prop | Type | Default |
|---|---|---|
axis | 'horizontal' | 'vertical' | 'both' | 'both' |
children | ReactNode | - |
className | string | - |
For a complete list of props, see the Ark UI documentation.