RepositoryTypeScriptHUHungary
pqoqubbw

pqoqubbw/zriz

headless image cropper for react and typescript. crop, straighten, rotate, flip and zoom, with the feel of ios photos

76sao
0fork
0issue
2lượt xem

Thành tựu nổi bật

Những danh hiệu mới nhất của dự án

1
TINIX TRENDING·Quốc gia: HU

#1 Repository của ngày

1
TINIX TRENDING·Chủ đề: image-crop

#1 Repository của ngày

1
TINIX TRENDING·Chủ đề: image-cropper

#1 Repository của ngày

zriz

Headless image cropper for React and plain TypeScript, with the feel of the crop tool in iOS Photos. Crop a photo, straighten it with a dial, rotate, flip and zoom it, then export the result.

  • Unstyled parts you compose and style yourself, plus an optional stylesheet.
  • Pinch, twist, wheel and trackpad zoom, with a rubber band at the edges.
  • No empty corners at any angle, on screen and in the exported file.
  • Full keyboard control, screen reader labels and reduced motion.
  • Export in a worker from the full-resolution photo, or crop on your server with sharp. A cropped JPEG never comes out at a higher quality than the photo it came from.
  • Opens SVG too, after a check that refuses a file that would freeze the page.
  • Zero runtime dependencies. React 18.2 and 19 from one build, and a plain TypeScript API for everything else.

Docs, demos and the API live at zriz.dev.

Install

pnpm add @zriz/react @zriz/core
"use client";

import * as Cropper from "@zriz/react/cropper";

import "@zriz/react/styles.css";

export const PhotoCropper = ({ photo }: { photo: File }) => (
  <Cropper.Root
    src={photo}
    onValueCommit={(value, details) => console.log(details.pixelCrop)}
  >
    <Cropper.Viewport style={{ maxWidth: 400, height: 300, padding: 24 }}>
      <Cropper.Image />
      <Cropper.Mask />
      <Cropper.Area aria-label="Crop area">
        <Cropper.Handle position="top-left" />
        <Cropper.Handle position="top-right" />
        <Cropper.Handle position="bottom-right" />
        <Cropper.Handle position="bottom-left" />
      </Cropper.Area>
    </Cropper.Viewport>
    <Cropper.Dial aria-label="Straighten" style={{ maxWidth: 361 }}>
      <Cropper.DialTicks />
    </Cropper.Dial>
  </Cropper.Root>
);

Quick start goes from here to a file picker and the crop in pixels.

Packages

Package
@zriz/reactUnstyled React parts and hooks
@zriz/coreGeometry, the coverage solver, DOM binders, export

Found a bug or want a feature

Open an issue. I don't take pull requests. CONTRIBUTING.md explains why and what helps most instead.

License

MIT

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

RepositorySwift
guoyingtao/Mantis

An iOS image cropping library for UIKit and SwiftUI, mimicking the Photos app — crop shapes, rotation, flip, perspective correction, undo/redo. iOS & Mac Catalyst.

1.2k
Nov 6, 2026
RepositoryTypeScript
trpc/trpc

🧙‍♀️ Move Fast and Break Nothing. End-to-end typesafe APIs made easy.

40.9k
Dec 1, 2026
RepositoryTypeScript
shadcn-ui/ui

Composable, accessible components with thoughtful defaults. Build your own component library with code you can customize, extend, and make your own.

129.8k
Dec 2, 2026
RepositoryJavaScript
vercel/next.js

The React Framework

143.9k
Dec 1, 2026
RepositoryJavaScript
vercel/next.js

The React Framework

143.9k
Dec 1, 2026
RepositoryTypeScript
ant-design/ant-design

An enterprise-class UI design language and React UI library

100.5k
Dec 2, 2026
RepositoryTypeScript
ChatGPTNextWeb/NextChat

✨ Zero-config AI chat assistant. No API key needed — sign up and instantly chat with GPT-5, Claude 4, Gemini 2.5, DeepSeek & 100+ top models. Pay-as-you-go saves you more. Available on Web, iOS, macOS, Android, Linux, Windows.

89.0k
Oct 20, 2026
RepositoryTypeScript
twentyhq/twenty

The open alternative to Salesforce, designed for AI.

61.7k
Nov 30, 2026
RepositoryTypeScript
FlowiseAI/Flowise

Build AI Agents, Visually

55.6k
Aug 13, 2026