MCPcopy
hub / github.com/yoopta-editor/Yoopta-Editor

github.com/yoopta-editor/Yoopta-Editor @v6.0.2 sqlite

repository ↗ · DeepWiki ↗ · release v6.0.2 ↗
1,431 symbols 4,045 edges 807 files 97 documented · 7%
README

Buy Me A Coffee

npm downloads

Yoopta-Editor v6

Motivation. Why Yoopta?

Yoopta is fully open source and built with all my heart and love. It was born from real pain

I've integrated rich-text editors into products more times than I'd like to admit. Every time it was the same story: wrestling with complex APIs, fighting against opinionated UI that doesn't fit your product, hacking around limitations, and writing glue code that makes you mass text your wife and check hair transplant prices (I'm currently accepting donations for the procedure — every star on GitHub brings me one follicle closer).

Yoopta was built to end that cycle. The idea is simple: give developers a headless core when they need full control, but also ship 20+ ready-made plugins, pre-built UI components (toolbars, slash menus, block actions), and theme presets (shadcn, Material) — so you can launch a polished editing experience without thinking about implementing a rich-text editor in your project and engage in other business tasks

Whether you're building a simple blog editor, a Notion-like workspace, a CMS for landing pages, or even a full website builder — Yoopta gives you the primitives to get there

If Yoopta saves you time, consider starring the repo or sponsoring the project. It keeps the project alive

Introduction

Yoopta-Editor is a free, open-source rich-text editor built for React apps. It's packed with features that let you build an editor as powerful and user-friendly as Notion, Craft, Coda, Medium etc. — or go further and build a CMS, landing page builder, or website builder on top of it.

Built on top of Slate.js with a powerful plugin architecture, Yoopta-Editor gives you the flexibility to customize everything—tweak the look, add features, or craft a completely custom user interface. The core is headless by default; Yoopta also provides pre-built theme presets so you can get a full editing experience and start quickly (shadcn theme @yoopta/themes-shadcn is available now; Material theme is in progress). Pre-built UI components via @yoopta/ui (toolbars, menus, block actions) let you improve the editing experience without building everything from scratch.

Examples & Demos

See what you can build with Yoopta:

Example Description Demo Source
Full Setup Complete editor with toolbar, slash menu, block actions, drag & drop, and mentions Live Source
CMS / Website Builder Visual page builder with drag-and-drop blocks, sidebar settings, and live preview — build landing pages and websites Live Source
Word Example Microsoft Word-inspired editor with fixed toolbar, formatting, tables, and export to HTML/Markdown/Text/JSON Live Source
Email Builder Email composition tool with templates, signatures, split-view editing, HTML preview, and email-safe export Live Source
README Editor GitHub-flavored Markdown editor with live preview, section templates, and download as README.md Live Source
Slack Chat Slack-style messaging with channel list, rich text composer, mentions, and emoji support Live Source
Social Media Chat WhatsApp/Instagram-like chat with message bubbles, attachments, reactions, and status indicators Live Source
Collaboration Real-time multi-user editing with Yjs, remote cursors, and presence awareness Live Source
Nested Plugins Injecting child elements from other plugins into Accordion, Tabs, and Carousel components Live Source
Large Document Performance stress test with a large dataset to demonstrate scalability with many blocks Live Source

Features

  • Easy setup — Sensible defaults; plugins and marks passed to createYooptaEditor, then render <YooptaEditor />
  • 20+ plugins — Paragraph, headings, lists, code, image, video, table, callout, accordion, tabs, steps, divider, embed, file, link, mention, carousel, table-of-contents, and more
  • Headless core — Full control over UI; optional pre-built theme presets (@yoopta/themes-shadcn available, @yoopta/themes-material in progress) for styled block UI
  • Pre-built UI components (@yoopta/ui) — FloatingToolbar, SlashCommandMenu, ActionMenuList, BlockOptions, ElementOptions, FloatingBlockActions, SelectionBox, BlockDndContext so you don't have to build everything from scratch
  • Blocks, Elements, Marks APIs — Programmatic control: insert/update/delete blocks and elements, apply text formatting (Bold, Italic, Highlight, etc.), custom marks supported
  • Undo/redo — Built-in history with editor.undo() / editor.redo(); batch operations for single undo step
  • Drag and drop — Reorder blocks with nested depth support; optional SortableBlock for custom DnD
  • Selection box — Multi-block selection for copy, delete, or bulk operations
  • Slash command & action menu — Type / for block insertion; floating block actions (+, drag handle, block options)
  • Inline elements — Links, @mentions, and custom inline nodes within text
  • Export — HTML, Markdown, plain text, email template; get/set content as Yoopta JSON
  • Real-time collaboration (@yoopta/collaboration) — Multi-user editing with Yjs CRDT, presence (awareness), remote cursors, and WebSocket provider; optional package for collaborative documents
  • Eventseditor.on('change' | 'focus' | 'blur' | 'path-change' | 'block:copy') for sync, analytics, or custom logic
  • Keyboard shortcuts — Customizable hotkeys; Tab/Shift+Tab for indent/outdent; shortcuts per plugin and mark
  • Read-only mode — Use the same editor instance for viewing or editing
  • TypeScript — Full type definitions for editor, blocks, elements, and plugins
  • Mobile friendly — Touch support; works in responsive layouts
  • Custom plugins & marks — Define new block types or text formats and plug them in
  • Media & large docs — Image/video optimization, lazy loading; performant with many blocks
  • Theming — CSS variables (light/dark); theme packages for plugin element styling

Installation

# Install peer dependencies and core packages
yarn add slate slate-react slate-dom @yoopta/editor

# Add plugins you need
yarn add @yoopta/paragraph @yoopta/headings @yoopta/lists @yoopta/blockquote @yoopta/code @yoopta/image @yoopta/video @yoopta/embed @yoopta/file @yoopta/callout @yoopta/divider @yoopta/accordion @yoopta/table @yoopta/tabs @yoopta/steps @yoopta/mention @yoopta/links

# Add marks for text formatting
yarn add @yoopta/marks

# Add UI components
yarn add @yoopta/ui

# Optional: theme for styled block UI (Shadcn or Material)
yarn add @yoopta/themes-shadcn

# Optional: real-time collaboration (Yjs, awareness, remote cursors)
yarn add @yoopta/collaboration

Quick Start

Plugins, initial value and marks are passed to createYooptaEditor

import { useMemo, useEffect } from 'react';
import YooptaEditor, { createYooptaEditor, type YooptaContentValue } from '@yoopta/editor';
import Paragraph from '@yoopta/paragraph';
import Headings from '@yoopta/headings';
import { Bold, Italic, Underline, Strike, CodeMark, Highlight } from '@yoopta/marks';

const PLUGINS = [Paragraph, Headings.HeadingOne, Headings.HeadingTwo, Headings.HeadingThree];
const MARKS = [Bold, Italic, Underline, Strike, CodeMark, Highlight];

const initialValue = {} as YooptaContentValue;

const EDITOR_STYLES = {
  width: 750,
  // useful when you want to create default block by clicking on empty are
  paddingBottom: 150,
};

export default function Editor() {
  const editor = useMemo(
    () => createYooptaEditor({ plugins: PLUGINS, marks: MARKS, value: initialValue }),
    [],
  );

  return (
    <YooptaEditor
      editor={editor}
      style={EDITOR_STYLES}
      placeholder="Type / to open menu"
      onChange={(value) => console.log('onChange', value)}
    />
  );
}

Themes

The editor and plugins are headless by default. For styled block UI you can use a theme package:

  • @yoopta/themes-shadcn — Shadcn UI styled components (production ready)
  • @yoopta/themes-material — Material Design (in progress)

Option 1: Apply theme to all plugins

import { applyTheme } from '@yoopta/themes-shadcn';

const plugins = applyTheme([
  Paragraph,
  Callout,
  Headings.HeadingOne,
  Headings.HeadingTwo,
  Headings.HeadingThree,
]);
const editor = createYooptaEditor({ plugins, marks: MARKS });

Option 2: Apply theme UI to a single plugin

import Callout from '@yoopta/callout';
import { CalloutUI } from '@yoopta/themes-shadcn/callout';

const CalloutWithUI = Callout.extend({ elements: CalloutUI });
// Use CalloutWithUI in your plugins array

See docs/core/themes for the full concept.

Adding UI Components

All UI (toolbar, slash menu, block actions) must be children of <YooptaEditor> so they can use useYooptaEditor(). Yoopta provides ready-to-use components from @yoopta/ui:

```tsx import { useMemo, useState, useRef } from 'react'; import YooptaEditor, { createYooptaEditor, Blocks, Marks, useYooptaEditor } from '@yoopta/editor'; import { FloatingToolbar, FloatingBlockActions, BlockOptions, SlashCommandMenu } from '@yoopta/ui';

// Floating toolbar for text formatting function MyToolbar() { const editor = useYooptaEditor();

return ( {editor.formats.bold && ( Marks.toggle(editor, { type: 'bold' })} active={Marks.isActive(editor, { type: 'bold' })}> B )} ); }

// Floating block actions (plus button, drag handle) function MyFloatingBlockActions() { const editor = useYooptaEditor(); const [blockOptionsOpen, setBlockOptionsOpen] = useState(false); const dragHandleRef = useRef(null);

return ( {({ blockId }) => ( <> { if (!blockId) return; const block = Blocks.getBlock(editor, { id: blockId }); if (block) editor.insertBlock('Paragraph', { at: block.meta.order + 1, focus: true }); }}> + setBlockOptionsOpen(true)}> ⋮⋮

      <BlockOptions
        open={blockOptionsOpen}
        onOpenChange={setBlockOptionsOpen}
        anchor={dragHandleRef.current}>
        <BlockOptions.Content>{/* Block options menu items */}</BlockOptions.Content>

Extension points exported contracts — how you extend this code

CustomTypes (Interface)
(no doc)
packages/core/editor/src/slate.d.ts
Window (Interface)
(no doc)
packages/themes/shadcn/src/code-group/elements/code-group-container.tsx
Window (Interface)
(no doc)
packages/plugins/code/src/utils/shiki.ts
MockSlateEditor (Interface)
(no doc)
tests/test-utils.tsx
ComparisonFeature (Interface)
(no doc)
web/next-app-example/components/landing/comparison.tsx
IntrinsicElements (Interface)
(no doc)
packages/core/editor/src/jsx.d.ts
Window (Interface)
(no doc)
packages/themes/shadcn/src/code/elements/code.tsx
MockYooEditor (Interface)
(no doc)
tests/test-utils.tsx

Core symbols most depended-on inside this repo

cn
called by 104
packages/themes/shadcn/src/utils.ts
cn
called by 95
web/next-app-example/lib/utils.ts
keys
called by 93
packages/core/collaboration/src/binding/block-content-binding.ts
generateId
called by 86
packages/core/editor/src/utils/generateId.ts
serializeTextNodes
called by 81
packages/core/editor/src/parsers/serializeTextNodes.ts
useYooptaEditor
called by 81
packages/core/editor/src/contexts/YooptaContext/YooptaContext.tsx
insertBlock
called by 65
packages/core/collaboration/src/binding/block-meta-binding.ts
deleteBlock
called by 61
packages/core/collaboration/src/binding/block-meta-binding.ts

Shape

Function 1,301
Method 95
Class 20
Interface 14
Enum 1

Languages

TypeScript100%

Modules by API surface

web/next-app-example/components/playground/examples/word-example/word-toolbar.tsx39 symbols
packages/core/collaboration/src/binding/slate-content-binding.ts29 symbols
web/next-app-example/components/ui/sidebar.tsx25 symbols
packages/plugins/video/src/utils/providers.ts24 symbols
packages/core/collaboration/src/binding/y-doc-binding.ts20 symbols
packages/themes/shadcn/src/ui/dropdown-menu.tsx15 symbols
packages/plugins/video/src/hooks/use-upload.ts15 symbols
web/next-app-example/components/playground/examples/slack-chat/slack-chat-editor.tsx14 symbols
packages/core/editor/src/utils/execute-backspace-action.ts14 symbols
packages/core/editor/src/plugins/build-plugin-elements.test.ts14 symbols
packages/core/collaboration/src/binding/block-content-binding.ts13 symbols
packages/plugins/image/src/hooks/use-upload.ts12 symbols

Dependencies from manifests, versioned

@changesets/cli2.29.4 · 1×
@dnd-kit/core6.1.0 · 1×
@dnd-kit/sortable8.0.0 · 1×
@dnd-kit/utilities3.2.2 · 1×
@emotion/react11.11.4 · 1×
@emotion/styled11.11.5 · 1×
@faker-js/faker10.3.0 · 1×
@floating-ui/dom1.6.11 · 1×
@floating-ui/react0.26.9 · 1×
@mui/icons-material7.3.6 · 1×
@mui/material5.16.0 · 1×
@playwright/test1.30.0 · 1×

For agents

$ claude mcp add Yoopta-Editor \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact