photocn

The full editor

One component with every tool. Use it as is, or trim it down.

Trim it, extend it

Pass tools to choose which tools appear in the switcher, and panels to replace a built-in panel or add a panel for your own tool. Custom panels call useImageEditor() like the built-in ones do.

Props

ImageEditor accepts every option of useImageEditorState (see the API reference), plus:

PropTypeDescription
editorImageEditorApiState you created with useImageEditorState(). Otherwise the editor owns its state.
toolsEditorToolbarTool[]Tools in the sidebar switcher. Default: all built-in tools.
panelsRecord<toolId, ReactNode>Replace or add sidebar panels per tool id.
showOpenButtonbooleanShow the Open button and the empty-state picker. Default true.
showRecipesbooleanShow the recipe save/load buttons. Default true.
showHistogrambooleanShow the histogram strip. Default true.
toolbarExtraReactNodeExtra toolbar content, placed before Export.
sidebarExtraReactNodeContent below the active panel.
onSave(result) => void | Promise<void>Adds a Save button to the export dialog, e.g. to upload the result.
childrenReactNodeRendered inside the provider, e.g. <ImageEditorCommandMenu />.