photocn

Compose your own

Wrap any layout in a provider and place the pieces wherever you want.

How it fits together

<ImageEditorProvider> owns the image, the edit params and the undo history. Every ImageEditor* component below it reads the provider through useImageEditor(), so they stay in sync without any wiring from you.

<ImageEditorProvider src={file} onParamsChange={save}>
  <ImageEditorCanvas />          {/* the image */}
  <ImageEditorAdjustments />     {/* any panel */}
  <ImageEditorUndoButton />      {/* any control */}
  <MyOwnThing />                 {/* useImageEditor() inside */}
</ImageEditorProvider>

A compact editor

Canvas, adjustments, history, compare and export: five pieces.

Your own controls

The filter strip below is custom JSX. It lists editor.filters.presets, calls editor.filters.select(), and renders the shared canvas.

Controlled pieces

Each panel file also exports its plain controlled version (AdjustmentPanel, CurvesPanel, FiltersPanel, and so on) that takes value and onChange. Use those to drive a panel from your own state, or outside a provider.