Introduction to Post Canvas
Post Canvas is a React editor for posts and articles, with rich text, photo galleries, embeds and a safe way to show what people write.
Post Canvas is a React editor for posts and articles. It is built on Tiptap 3 (a toolkit on top of ProseMirror, the editing engine) and stores every document as Tiptap JSON. You get a full rich-text editor and a media canvas in one package, plus the server code to check and show what people write. It is MIT licensed.
What you get
- Rich text. Headings, lists, task lists, tables, code blocks with syntax highlighting, quotes, colours, links, mentions and hashtags, and a toolbar, a selection menu and a
/menu. - A media canvas. Images, files, and galleries in four layouts: carousel, grid, masonry and collage. Blocks have a
+button and a handle, and you can drag them to reorder. - Embeds. YouTube and Vimeo videos, social and map embeds, and link cards. Players load only after a click, unless you choose otherwise.
- Presets.
full,article,socialandcommentturn on the right parts for a long article, a post composer or a comment box. See presets and features. - A safe output pipeline.
post-canvas/renderandpost-canvas/serversanitize, validate and render documents without the editor, on the server or in the browser. See security. - No-React builds.
post-canvas/vanillaand a CDN bundle mount the editor on any page. See CDN and plain HTML. - Languages. English, German, Spanish, French, Italian and Portuguese.
Try it in the live playground.
Install
npm install post-canvasThe package is ESM only. React and React DOM 18.2 or newer (including 19) are peer dependencies. Installation lists every entry point and the browser support.
A first editor
import { PostCanvas } from 'post-canvas';
import 'post-canvas/styles.css';
export default function App() {
return <PostCanvas preset="article" onChange={({ json }) => console.log(json)} />;
}onChange receives the document as JSON. Save that JSON, and show it later with renderToHTML or PostCanvasView. Content is uncontrolled: you pass defaultContent once and read changes through onChange.
How it fits together
- The editor (
PostCanvas) produces a document as JSON. - Your adapters connect the editor to your app: file uploads, mentions, link previews and draft storage. Post Canvas has no backend of its own.
- Your server runs
sanitizeDocumenton the JSON it receives, then stores it. - Readers see the saved document through rendering: an HTML string or a React component, with no editor code.
What it does not do
Be aware of these before you pick it:
- No real-time collaboration, comments, AI features, emoji shortcodes or right-to-left text yet.
- No Vue or Angular wrappers. The vanilla build and the CDN bundle work in any page, but the editor itself is React.
- No upload storage. Without an upload adapter the image, gallery and file features are off.
- No HEIC converter. You pass one in; see the uploads guide.
- The
+button is made for mouse and touch. Keyboard users insert blocks through/and the toolbar's Insert button, and move blocks with Alt-Shift-Up and Alt-Shift-Down. See keyboard and accessibility.
Where to go next
| You want to | Read |
|---|---|
| Install and set up | Installation, then React and Vite, Next.js or CDN |
| Understand the data | Document JSON |
| Choose what the editor offers | Presets and features |
| Connect uploads and previews | Adapters |
| Show saved posts | Rendering |
| Accept documents safely | Security |