Polotno Design Editor Framework

2.40.0 · active · verified Sun Apr 19

Polotno is a JavaScript library and React component SDK designed for building versatile, white-label canvas-based design editors. It provides a comprehensive framework for creating applications that handle image, video, and graphic design, as well as template systems and programmatic asset generation. The current stable version is 2.40.0, with frequent minor releases occurring typically on a weekly or bi-weekly basis, as evidenced by its detailed changelog. Key differentiators include its highly customizable React component architecture, which allows developers to replace or extend almost any part of the UI, and its flexible rendering options supporting both client-side and server-side generation via `polotno-node`. Unlike lower-level canvas libraries like Konva.js, Polotno offers a complete, opinionated solution built on MobX for state management, simplifying the development of full-featured design suites for various business applications, including print-on-demand, marketing automation, and digital signage platforms. It supports importing JSON, SVG, and exporting to JSON, PNG, JPEG, PDF, MP4, and more. A commercial API key is required for production use.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart initializes a basic Polotno design editor with a side panel, toolbar, and workspace, rendered as a React component. It sets up the core store, adds a default page, and includes necessary CSS. An API key is required.

import React from 'react';
import ReactDOM from 'react-dom/client';
import { PolotnoContainer, SidePanelWrap, WorkspaceWrap } from 'polotno';
import { Toolbar } from 'polotno/toolbar/toolbar';
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 '@blueprintjs/core/lib/css/blueprint.css'; // Polotno uses Blueprint.js styles

const store = createStore({
  key: process.env.POLOTNO_API_KEY ?? 'YOUR_FREE_API_KEY_HERE',
  showCredit: true // Set to false with a paid license to hide the back-link
});

// Add a default page to the store
store.addPage();

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

// Example of how to render it in a root (e.g., in index.tsx)
/*
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
  <React.StrictMode>
    <PolotnoEditor />
  </React.StrictMode>
);
*/

view raw JSON →