Sections
@editorcn/editor
@editorcn/block-editor
@editorcn/extensions
@editorcn/static-renderer
A document page: a breadcrumb header with collaborators, a floating toolbar, and a paper-style page with a large editable title. The toolbar covers text styles, fonts, text and highlight colors, superscript and subscript, lists with indent and outdent, alignment, and an Insert menu for images, tables, quotes, code blocks and dividers. The header menu imports, exports and copies the document as Markdown. A status bar shows word count, reading time and keyboard shortcuts.
ATNKLN
Installation
$ pnpm dlx shadcn@latest add "https://www.rtecn.space/r/simple-document-editor.json"
The CLI also installs the Image Placeholder, Table, Markdown, Paste Cleanup and Code Block extensions. Your project needs Tailwind CSS and shadcn/ui; see the template requirements.
Usage
import { SimpleDocumentEditor } from "@/components/templates/simple-document-editor";
export const Doc = ({ doc }) => (
<SimpleDocumentEditor
initialTitle={doc.title}
initialContent={doc.content}
onChange={(content) => saveDocument(doc.id, content)}
onTitleChange={(title) => renameDocument(doc.id, title)}
onShare={() => openShareDialog(doc.id)}
/>
);Props
| Prop | Type | Description |
|---|---|---|
initialContent | Content | Tiptap JSON or HTML to start with |
initialTitle | string | Title for the breadcrumb and page |
onChange | function | Gets the document as Tiptap JSON |
onTitleChange | function | Gets the new title |
onShare | function | Shows a Share button when set |
collaborators | DocumentCollaborator[] | Avatars in the header |
path | string[] | Breadcrumb segments before the title |
className | string | Outer container classes |
More templates
From the editorcn authoreditorcn pro
Ready-made editor apps built on editorcn: a chat composer, a document editor, a blog post editor, and a Notion-style notes workspace. Install them with the shadcn CLI.