Skip to main content

Documentation Index

Fetch the complete documentation index at: https://superdoc-caio-sd-2929-configurable-toolbar.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

SuperDoc provides @superdoc-dev/react: a first-party wrapper with lifecycle management, SSR safety, and React Strict Mode compatibility.

Install

npm install @superdoc-dev/react
superdoc is included as a dependency: no need to install it separately.

Quick start

import { SuperDocEditor } from '@superdoc-dev/react';
import '@superdoc-dev/react/style.css';

function App() {
  return (
    <SuperDocEditor
      document={file}
      documentMode="editing"
      onReady={() => console.log('Editor ready!')}
    />
  );
}

Core concepts

Document modes

ModeDescription
editingFull editing capabilities
viewingRead-only presentation
suggestingTrack changes mode
<SuperDocEditor document={file} documentMode="editing" />

User roles

RoleCan EditCan SuggestCan View
editorYesYesYes
suggesterNoYesYes
viewerNoNoYes
<SuperDocEditor document={file} role="editor" />

Handle file uploads

import { useState } from 'react';
import { SuperDocEditor } from '@superdoc-dev/react';
import '@superdoc-dev/react/style.css';

function FileEditor() {
  const [file, setFile] = useState(null);

  const handleFileChange = (e) => {
    const selected = e.target.files?.[0];
    if (selected) setFile(selected);
  };

  return (
    <div>
      <input type="file" accept=".docx" onChange={handleFileChange} />
      {file && (
        <SuperDocEditor
          document={file}
          user={{ name: 'User', email: 'user@company.com' }}
        />
      )}
    </div>
  );
}

Next steps

React API Reference

Props, ref API, TypeScript types, and patterns

Custom UI

Build custom toolbar, comments sidebar, and review panel with typed React hooks

Configuration

Full SuperDoc configuration options

Collaboration

Real-time collaboration setup

React Example

React + TypeScript example

Next.js Example

Next.js SSR integration