photocn

Search

Search the docs

3

Introduction

Photo editor components for React, built for shadcn/ui.

photocn is a photo editor you install with the shadcn CLI. Add the whole editor with one command, or pick the pieces you need and arrange them yourself. The files are copied into your project, so you can change anything.

"use client";

import { ImageEditor } from "@/components/image-editor/image-editor";

export default function FullEditorExample() {
  return <ImageEditor className="h-[680px] overflow-hidden rounded-xl border" src="/samples/mountain-lake.jpg" />;
}

How it works

photocn has two parts:

  • The engine: the photocn npm package. It does the image work: WebGL rendering in a background thread, filters, crop and rotate, EXIF, undo history, and export.
  • The components: the editor UI, installed into components/image-editor/ by the shadcn CLI. They use your theme and your shadcn/ui components, built on Base UI (shadcn's default; see Installation).

You get engine fixes from npm updates, and the UI stays yours.

Three ways to use it

Features

  • Light, color and effect adjustments
  • Curves for RGB and each channel, over a live histogram
  • 13 filters
  • Crop, straighten, perspective, rotate and flip, all reversible
  • Lens blur and image blending
  • Undo and redo, and hold to compare with the original
  • PNG, JPEG (keeps EXIF) and WebP export, at any size
  • Works on phones: bottom tool bar, panels in a sheet, pinch to zoom
  • Display P3 color