superdoc-dev/agent-skills/superdoc-react
Claude Code and agent skill by superdoc-dev/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
React integration guidelines for SuperDoc document editor. Use when adding document editing capabilities to React or Next.js applications, working with DOCX files, or implementing collaboration features. Triggers on tasks involving document editors, DOCX handling, or SuperDoc integration.
Install
npx vskill@latest install superdoc-dev/agent-skills/superdoc-reactSKILL.md
SuperDoc React Integration
Official React wrapper for SuperDoc - the document editing and rendering library for the web. Provides component-based API with proper lifecycle management and React Strict Mode compatibility.
When to Apply
Reference these guidelines when:
- Adding document editing to a React application
- Integrating SuperDoc with Next.js
- Implementing DOCX file upload/export
- Setting up real-time collaboration
- Building document viewers or editors
Installation
superdocis included as a dependency - no separate installation needed.
Quick Start
Component API
Document Props
| Prop | Type | Default | Description | ||||
|---|---|---|---|---|---|---|---|
document | `File \ | Blob \ | string \ | object` | required | Document to load | |
documentMode | `'editing' \ | 'viewing' \ | 'suggesting'` | 'editing' | Editing mode | ||
role | `'editor' \ | 'viewer' \ | 'suggester'` | 'editor' | User permissions |
User Props
| Prop | Type | Description | |
|---|---|---|---|
user | { name, email?, image? } | Current user info | |
users | Array<{ name, email, image? }> | All users (for @-mentions) |
UI Props
| Prop | Type | Default | Description | |
|---|---|---|---|---|
id | string | auto-generated | Custom container ID | |
hideToolbar | boolean | false | Hide the toolbar | |
rulers | boolean | - | Show/hide rulers | |
className | string | - | CSS class for wrapper | |
style | CSSProperties | - | Inline styles | |
renderLoading | () => ReactNode | - | Custom loading UI |
Event Callbacks
| Prop | Type | Description | |
|---|---|---|---|
onReady | ({ superdoc }) => void | Editor initialized | |
onEditorCreate | ({ editor }) => void | ProseMirror editor created | |
onEditorDestroy | () => void | Editor destroyed | |
onEditorUpdate | ({ editor }) => void | Content changed | |
onContentError | (event) => void | Document parsing error | |
onException | ({ error }) => void | Runtime error |
Advanced Props
| Prop | Type | Description | |
|---|---|---|---|
modules | object | Configure collaboration, AI, comments |
Ref API
Access SuperDoc methods via ref:
Available Methods
| Method | Returns | Description | ||
|---|---|---|---|---|
getInstance() | `SuperDoc \ | null` | Access underlying instance | |
setDocumentMode(mode) | void | Change mode without rebuild | ||
export(options?) | `Promise<Blob \ | void>` | Export as DOCX | |
getHTML(options?) | string[] | Get document as HTML | ||
focus() | void | Focus the editor | ||
search(text) | SearchResult[] | Search document | ||
goToSearchResult(match) | void | Navigate to result | ||
setLocked(locked) | void | Lock/unlock editing | ||
toggleRuler() | void | Toggle ruler visibility |
Common Patterns
Document Mode Switching
The component handles documentMode prop changes efficiently without rebuilding:
File Upload
Loading State
View-Only Mode
With User Info
Next.js Integration
The React wrapper handles SSR automatically (renders null or renderLoading() on server, initializes after hydration).
App Router (Next.js 13+)
Pages Router
With Dynamic Import (Optional)
For custom loading UI during SSR:
CSS Import in Layout
Import styles once in your layout:
Collaboration Setup
Props That Trigger Rebuild
These props trigger a full instance rebuild when changed:
| Prop | Reason | |
|---|---|---|
document | New document to load | |
user | User identity changed | |
users | Users list changed | |
modules | Module configuration changed | |
role | Permission level changed | |
hideToolbar | Toolbar DOM structure changed |
Other props like documentMode and callbacks are handled efficiently without rebuild.
TypeScript
Types are extracted from the superdoc package, ensuring they stay in sync.
Requirements
| Requirement | Version | |
|---|---|---|
| React | 16.8.0+ | |
| Node.js | 16+ |
Examples
| Example | Description | |
|---|---|---|
| React + TypeScript | File upload, mode switching, export | |
| Next.js SSR | App Router with SSR support |
Links
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/superdoc-react/SKILL.md
Popularity
- Repository stars
- 1
- Repository forks
- 1
- 7-day trend score
- 3
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 2 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/superdoc-dev/agent-skills/superdoc-react)