> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superdoc.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Solid Integration

SuperDoc works in Solid through the core `superdoc` package. Mount it into a DOM element, clean it up on unmount, and drive it with Solid's fine-grained reactivity.

> [!NOTE]
>
> SuperDoc does not ship a first-party Solid wrapper. Use the core `superdoc` package directly, or build a community wrapper on top of it.

## Install

```bash theme={null}
npm install superdoc@1 @superdoc-dev/fonts
```

## Quick start

```tsx theme={null}
import { onCleanup, onMount } from 'solid-js';
import { SuperDoc } from 'superdoc';
import { superdocFonts } from '@superdoc-dev/fonts';
import 'superdoc/style.css';

export default function App() {
  let superdoc: SuperDoc | undefined;
  const editorId = 'superdoc-editor';

  onMount(() => {
    superdoc = new SuperDoc({
      selector: `#${editorId}`,
      fonts: superdocFonts,
    });
  });

  onCleanup(() => {
    superdoc?.destroy();
  });

  return <div id={editorId} style={{ height: '700px' }} />;
}
```

## Core concepts

### Document modes

| Mode | Description |
| - | - |
| `editing` | Full editing capabilities |
| `viewing` | Read-only presentation |
| `suggesting` | Track changes mode |

```tsx theme={null}
new SuperDoc({
  selector: `#${editorId}`,
  document: file(),
  documentMode: 'editing',
});
```

### User roles

| Role | Can Edit | Can Suggest | Can View |
| - | - | - | - |
| `editor` | Yes | Yes | Yes |
| `suggester` | No | Yes | Yes |
| `viewer` | No | No | Yes |

```tsx theme={null}
new SuperDoc({
  selector: `#${editorId}`,
  document: file(),
  role: 'editor',
});
```

## Handle file uploads

```tsx theme={null}
import { createEffect, createSignal, onCleanup, Show } from 'solid-js';
import { SuperDoc } from 'superdoc';
import 'superdoc/style.css';

function FileEditor() {
  const [file, setFile] = createSignal<File | null>(null);
  const editorId = 'superdoc-editor';
  let superdoc: SuperDoc | undefined;

  createEffect(() => {
    const selected = file();
    if (!selected) return;

    superdoc = new SuperDoc({
      selector: `#${editorId}`,
      document: selected,
      user: { name: 'User', email: 'user@company.com' },
    });

    onCleanup(() => {
      superdoc?.destroy();
    });
  });

  return (
    <div>
      <input
        type='file'
        accept='.docx'
        onChange={(event) => {
          const selected = event.currentTarget.files?.[0];
          if (selected) setFile(selected);
        }}
      />
      <Show when={file()}>
        <div id={editorId} style={{ height: '700px' }} />
      </Show>
    </div>
  );
}
```

## Next steps

* [React Integration](https://docs.superdoc.dev/getting-started/frameworks/react.md) - React setup
* [API Reference](https://docs.superdoc.dev/editor/superdoc/configuration.md) - Configuration options
* [Examples](https://go.superdoc.dev/solid) - Working examples


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.