Open-source React editor

Posts with photos, video and links in one editor

Post Canvas is a rich-text editor with galleries, collages, video and social embeds built in, and output you can sanitize and render on your server. Built on Tiptap.

npm install post-canvas
Licence
MIT
React
18.2 and 19
Languages
6
Tests
425
preset="social"Live

Rich text

Writing tools people already know

A toolbar, a selection menu, a slash menu and a block handle, with mentions, tables and task lists. Try each one in the editor beside it.
Loading the editor

Galleries

Four layouts for the same photos

Upload a few photos and choose how they sit. Alt text, captions, reordering and upload progress are built in, and the reader sees the same layout.
Loading the editor

Embeds

Paste a link, get a block

Video, posts, music and maps become click-to-load players built from validated ids. Other links become cards from your own preview service.

YouTube, Vimeo, X, Instagram, TikTok, Spotify, SoundCloud, CodePen, Loom, Figma and Google Maps become players. Other links become cards. Players load only after a click.

Loading the editor

Presets

One editor, shaped for the job

A preset sets the features, limits and checks for a social post, an article or a comment box. Override any of it with the features prop.

A post that knows when it is an article

Bold, italic, links, mentions, hashtags, photos, galleries, video and embeds. No headings or tables.

  • The status bar names the kind: text, photo, video or embed post.
  • A second paragraph or a second photo makes it an article, and the title and cover appear.

<PostCanvas preset="social" />

Loading the editor

Safe output

Output you can trust on your server

A document is JSON. Render it as HTML, React, Markdown or text, and run the same sanitizer on your server before anyone else sees it.
Loading the editor

The sanitizer, on a hostile document

Edit the JSON on the left. The right side updates as you type, with every removal listed.

After sanitizeDocument()

Removed (4)

  • linkunsafe value at doc.content[0].content[0].marks[0]
  • imageunsafe value at doc.content[1]
  • iframenot in the schema at doc.content[2]
  • videounsafe value at doc.content[3]

Renders as

Claim your prize <img src=x onerror=alert(1)>

Thanks for reading.

HTML

<div class="pc-view" data-pc-theme="auto"><div class="pc-content"><p>Claim your prize &lt;img src=x onerror=alert(1)&gt;</p><p>Thanks for reading.</p></div></div>

Compare

How it compares

Post Canvas is young, and the table says where it is behind. The other columns summarise each project's public documentation as of November 2026; check them before you decide.
FeaturePost CanvasTinyMCEFroalaTiptapLexical
LicenceMITGPL-2.0 or later, or commercialCommercialMIT core, paid Pro extensionsMIT
Ready-made editor UIYesYesYesNo, you build itNo, you build it
Photo galleries and collageBuilt inNot built inNot built inYou build itYou build it
Video and social embedsBuilt in, click to loadMedia pluginVideo insertYouTube extensionYou build it
Sanitizer for saved content on your serverYes, the same schema as the editorBring your ownBring your ownBring your ownBring your own
Real-time collaborationNot yetPaid plansCollaboration plugin in the licenceYjs and HocuspocusYjs binding
Comments and track changesNot yetPaid pluginsIn the collaboration pluginTiptap Cloud productYou build it
FrameworksReact and plain HTMLReact, Vue, Angular and moreReact, Vue, Angular and moreAny, with React and Vue packagesAny, with React bindings

Quick start

Up and running in a few lines

Install from npm, import the stylesheet and render the editor. Or add the CDN build to any page, with no build step.
  1. 1InstallOne package. React 18.2 or 19 is the only peer dependency.
  2. 2RenderPick a preset, pass your adapters, keep the JSON from onChange.
  3. 3Save and showSanitize on your server, then render with PostCanvasView or renderToHTML.
  4. npm install post-canvas
import { PostCanvas } from 'post-canvas';
import 'post-canvas/styles.css';

export function Composer() {
  return (
    <PostCanvas
      preset="social"
      onChange={({ json }) => console.log(json)}
    />
  );
}

FAQ

Questions

Something else? Open an issue on GitHub.
Is Post Canvas free to use?

Yes. It is released under the MIT licence, so you can use it in commercial and closed-source products. The optional HEIC photo conversion uses heic-to, which is LGPL and which you install yourself if you want it.

Does it work with Next.js and React Server Components?

Yes. The editor is a Client Component. renderToHTML, PostCanvasView and sanitizeDocument run in Server Components and on any server, with no DOM, so saved posts render without shipping the editor to readers.

Can I use it without React?

Yes. The CDN build is one script and one stylesheet with React inside: call PostCanvas.create(element, options) on any page. With a bundler but no React, import post-canvas/vanilla.

Where do uploaded photos go?

Wherever your upload adapter sends them: S3, Cloudinary or your own route. The editor handles the picker, drag and drop, paste, progress, retry and cancel. Nothing is uploaded without your adapter.

Is it safe to show what people write?

Run sanitizeDocument on your server for any document a client sends. It keeps only what the schema allows, checks every URL and drops editor-only state. Players are built from validated ids at render time, never from stored HTML or iframe sources.

Does it support real-time collaboration?

Not yet. Collaboration, comments and track changes are on the roadmap. Today a document is plain Tiptap JSON that you save and load yourself.

How big is it?

About 282 kB gzipped for the editor with React external, and about 142 kB for renderToHTML on its own. The CDN file is about 389 kB with React inside. Code highlighting languages load only when a code block needs them.

Which languages does the interface speak?

English, German, Spanish, French, Italian and Portuguese. English ships in the main entry, the others are separate imports, and you can pass your own Locale object for any other language.

Try it with your own content

Switch presets, languages and features in the playground, then read the docs when you are ready to wire it up.