Getting Started

    Quick Start

    Scribe Editor is a modern, inline-first rich text editor under 50KB with zero dependencies. Get up and running in under two minutes.

    < 50KB

    Gzipped bundle size

    0

    Runtime dependencies

    4+

    Frameworks supported

    <!-- 1. Add a container element -->
    <div id="editor">
      <p>Start editing here...</p>
    </div>
    
    <script type="module">
      import { Scribe } from 'scribejs-editor';
    
      // One-line initialization
      const editor = Scribe.init('#editor');
    
      // Direct methods — no exec() needed
      editor.bold();
      editor.italic();
      editor.link('https://example.com');
      editor.heading(2);
    
      // Read content
      const html = editor.getHTML();
    </script>
    import { ScribeEditor, ScribeEditorRef } from 'scribejs-editor/react';
    import { useRef } from 'react';
    
    function MyEditor() {
      const ref = useRef<ScribeEditorRef>(null);
    
      return (
        <div>
          <button onClick={() => ref.current?.bold()}>Bold</button>
          <button onClick={() => ref.current?.italic()}>Italic</button>
          <ScribeEditor
            ref={ref}
            toolbar="floating"
            placeholder="Start writing..."
            onChange={(html) => console.log(html)}
          />
        </div>
      );
    }
    <script setup>
    import { ScribeEditor } from 'scribejs-editor/vue';
    import { ref } from 'vue';
    
    const editorRef = ref(null);
    const content = ref('');
    </script>
    
    <template>
      <div>
        <button @click="editorRef?.bold()">Bold</button>
        <ScribeEditor
          ref="editorRef"
          toolbar="floating"
          v-model="content"
        />
      </div>
    </template>

    Installation

    Install Scribe via your preferred package manager or load it directly from a CDN.

    Package Manager

    npm install scribejs-editor
    # or
    yarn add scribejs-editor
    # or
    pnpm add scribejs-editor

    CDN (no bundler needed)

    <script src="https://unpkg.com/scribejs-editor"></script>
    
    <script>
      const editor = Scribe.init('#editor');
    </script>

    ES Module (modern browsers)

    <script type="module">
      import { Scribe } from 'https://esm.sh/scribejs-editor';
      const editor = Scribe.init('#editor');
    </script>

    Next Steps