Polotno

React image editor: how to add one to your app

By Misha Zhuro · Apr 16, 2026

A React image editor is a set of React components around a canvas: a workspace that draws the design, a toolbar, a side panel for assets, and a store that holds the state. Users crop, add text and apply filters inside your app, and your code gets the result as an image, a PDF or JSON.

React image editor demo

Loading the live demo…

The editor above is Polotno SDK running on this page. This post shows how to put the same editor in a React app and which parts you can replace with your own.

“Polotno enabled us to give our users Canva-like abilities which for a while was our top requested feature”

Josiah Coad

Josiah Coad

Founder @ Marky

Install and render

bash
npm install polotno

The default 4.x line targets React 19. For React 18, see React version support.

tsx
import { PolotnoContainer, SidePanelWrap, WorkspaceWrap } from 'polotno';
import { Toolbar } from 'polotno/toolbar/toolbar';
import { PagesTimeline } from 'polotno/pages-timeline';
import { ZoomButtons } from 'polotno/toolbar/zoom-buttons';
import { SidePanel } from 'polotno/side-panel';
import { Workspace } from 'polotno/canvas/workspace';
import { createStore } from 'polotno/model/store';
import 'polotno/ui.css';

const store = createStore({ key: 'YOUR_API_KEY', showCredit: true });
store.addPage();

export const Editor = () => (
  <PolotnoContainer style={{ width: '100vw', height: '100vh' }}>
    <SidePanelWrap>
      <SidePanel store={store} />
    </SidePanelWrap>
    <WorkspaceWrap>
      <Toolbar store={store} downloadButtonEnabled />
      <Workspace store={store} />
      <ZoomButtons store={store} />
      <PagesTimeline store={store} />
    </WorkspaceWrap>
  </PolotnoContainer>
);

Each part is its own component. Leave out <PagesTimeline> and you have a single-page editor.

React image editor preview

The store holds the design

The store is a plain JavaScript object that lives outside React. It holds the pages and elements, and every Polotno component reads from it. Your code uses the same object:

js
const page = store.activePage;

page.addElement({
  type: 'image',
  src: '/product-photo.jpg',
  x: 0,
  y: 0,
  width: 600,
  height: 400,
});

const element = store.selectedElements[0];
element.set({ brightnessEnabled: true, brightness: 0.2 });

store.history.undo();

The store and element references list every method and property.

Add your own side panel

The side panel takes a list of sections, and a section is two components: a tab and a panel. Wrap the panel in observer from mobx-react-lite and it re-renders when the store changes.

tsx
import { observer } from 'mobx-react-lite';
import { SidePanel, SectionTab, TextSection } from 'polotno/side-panel';

const ProductsSection = {
  name: 'products',
  Tab: (props) => <SectionTab name="Products" {...props} />,
  Panel: observer(({ store }) => (
    <p>Elements on this page: {store.activePage?.children.length}</p>
  )),
};

export const Panel = () => (
  <SidePanel store={store} sections={[ProductsSection, TextSection]} />
);

This is how you connect the editor to your own data: a panel that lists the user's uploads, your product catalog, or brand assets from your DAM. The side panel guide covers the default sections and how to hide them.

Next.js

Polotno draws on a canvas, so the editor renders in the browser and never on the server. In the App Router, keep the editor in its own file and load it with server rendering off:

tsx
'use client';

import dynamic from 'next/dynamic';

const Editor = dynamic(() => import('../components/editor'), { ssr: false });

export default function Page() {
  return <Editor />;
}

The Next.js guide has a demo repository.

Get the result out

js
await store.saveAsImage({ pixelRatio: 2 }); // download a PNG
const dataUrl = await store.toDataURL({ mimeType: 'image/jpeg', quality: 0.85 });
await store.saveAsPDF();

const json = store.toJSON(); // save this to your database
store.loadJSON(json); // reopen the design later

Save the JSON alongside the exported file. With it, the user can reopen and change a design next month, and your backend can render the same design again at another size.

What you would build yourself

Polotno is built on Konva and react-konva, and the same team maintains all three. You can build a React image editor on react-konva directly. The canvas library gives you shapes, events and transforms. You then write the editor on top of it: resize handles for several selected elements, text editing on the canvas, undo history, font loading, snapping guides and export at print resolution. Polotno SDK vs Konva lists what each covers, and build vs buy covers the cost of each route.

A small job needs a small library. For an avatar cropper or a single crop step in an upload form, react-image-crop or react-avatar-editor is enough, and an SDK would be more than you need.

Polotno SDK is a commercial license. You can evaluate it on a 30-day free trial, no credit card needed.

Skip the build, cut dev costs, launch faster

TRUSTED BY

100,000+

CREATORS

300+

BUSINESSES

ExpediaUnbounceLovePopPostGridPredis.ai