Introduction
A Notion-style block editor for shadcn/ui that you install as source code.
blockcn is a Notion-style block editor for shadcn/ui, built on Tiptap. It installs like a shadcn component: one command copies the source into your project, and from then on it is your code.
Quick start
A working editor in about five minutes. Start here.
Installation
What gets installed, where it goes, and the project requirements.
Why blockcn
- You own the code. Files land in
src/components/editorandsrc/editor-core. No black-box SDK and no runtime license. blockcn is MIT licensed. - Matches your theme. The editor reads your shadcn CSS variables in light and dark mode.
- Doesn't touch your UI kit. The editor brings its own primitives under
components/editor/ui, so yourcomponents/uiis left alone. - Modular. Start with the core editor. Add tables, Ask AI or collaboration when you need them.
What you can install
| Registry item | What you get | Guide |
|---|---|---|
editor-shell | The editor: text blocks (including callouts, toggles and highlighted code), slash menu, drag handle, formatting toolbar, outline. | Basic editor |
export-menu | HTML, Markdown, and Word import and export, plus paste and PDF through the print dialog. Import shows a report first. Place <ExportMenu /> inside Editor. | Blocks and export |
media-blocks | Image, video, audio, file, and link blocks. | Blocks and export |
excalidraw-block | An Excalidraw whiteboard block. | Blocks and export |
table-toolbar | Tables with a row and column toolbar. | Blocks and export |
math | KaTeX inline math and math blocks. | Blocks and export |
columns | Notion-style 2–5 column layouts, made by dropping a block beside another. | Blocks and export |
mentions | @ mentions and a : emoji list. | Blocks and export |
toc | A table-of-contents block. | Blocks and export |
link-preview | A paste menu that turns a URL into a link, a mention chip, a bookmark, or an embed. | Blocks and export |
pages | Page mentions and page links. The app owns the page tree and routing. | Blocks and export |
ai-menu | The Ask AI panel. It is a client; you point it at your own streaming endpoint. | Ask AI |
collaboration | Real-time editing over Yjs, with presence avatars and remote carets. | Collaboration |
Requirements
- React 18.3 or 19, on Next.js (App Router or Pages Router), Vite, or React Router. See Supported stack.
- Tailwind CSS v4
- A
src/directory with the@/*path alias (shadcn initsets this up)
Keyboard basics
| Action | How |
|---|---|
| Insert a block | Type / on an empty line |
| Format text | Select text to open the toolbar |
| Move a block | Drag the handle to the left of the block |
| Undo / redo | Ctrl/⌘ + Z / Ctrl/⌘ + Shift + Z |