# 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.

```tsx
"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" />;
}
```

[Video](https://photocn.dev/assets/adjust.mp4)

## 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](https://base-ui.com) (shadcn's default; see [Installation](https://photocn.dev/docs/installation)).

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

## Three ways to use it

- [The full editor](https://photocn.dev/docs/editor): one component with every tool.
- [Compose your own](https://photocn.dev/docs/composition): put the pieces you want in your own layout.
- [Headless](https://photocn.dev/docs/headless): use the `useImageEditorState` hook with your own UI.
- [Without React](https://photocn.dev/docs/without-react): edit and export photos from plain JavaScript.

## 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](https://photocn.dev/docs/mobile): bottom tool bar, panels in a sheet, pinch to zoom
- Display P3 color
