Image crop
Crop an image before it is uploaded. Drag the frame to move it and a handle to resize it; a rule-of-thirds grid shows while you work. A fixed shape keeps only the corner handles, and every move works from the keyboard.

Drag the frame or a handle
When to use
- Avatars, covers and product photos that must fit a known shape.
- Trimming a screenshot or scan before it is attached.
When not to use
- Editing beyond the crop (rotate, filters); that is a media editor.
- Images the canvas cannot read: cross-origin files without CORS cannot be exported.
Installation
pnpm dlx shadcn@latest add @caliper/image-crop
Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
ImageCrop
7 props
cropImage
0 props
No props of its own; it accepts the native props of its root element.
centredCrop
0 props
No props of its own; it accepts the native props of its root element.
resizeCrop
4 props
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It exposes group and button semantics, with aria-roledescription and aria-label kept in step with state.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/image-crop.mdThe index of every part is at /llms.txt.