A shadcn-style image cropper component built with Ark UI primitives.

Installation

npx shadcn@latest add @ark-cn/image-cropper

Usage

import * as ImageCropper from "@/components/ui/image-cropper"

Read exported parts in src/components/ui/image-cropper.tsx and compose the primitive according to the Ark UI pattern for this component.

Examples

Aspect Ratio

Basic

Circle

Controlled Zoom

1.0×

Context

1.0x

Crop Preview

Preview

Click "Crop Image" to generate.

Events

Zoom
1.00x
Position
0, 0
Size
0 x 0

Fixed Crop Area

Flip

Initial Crop

Starts with a pre-defined crop area.

Min Max Size

Crop area constrained to min 80px and max 200px.

Reset

Root Provider

1.0x

Root Provider Zoom

1.0×

Rotation

0°

Zoom Limits

1.0x

Zoom constrained between 0.5x and 2x.

API reference

This component mirrors the upstream Ark UI primitive.

See the ARK UI documentation for the full API.