@monaco-editor/react

Drop the Monaco code editor into any React app without touching webpack, rollup, or bundler config files.

Library
npm
v4.7.0
4,731stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
54/100Fair
Development Activity12
Maintenance44
Community60
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
81/100Excellent
Architecture82
Code Quality74
Innovation80
Learning Curve88

@monaco-editor/react wraps the Monaco editor, the same code-editing engine that powers VS Code, in a single React component so you can add a full-featured code editor to any app without ejecting create-react-app, hand-rolling webpack loaders, or configuring rollup/vite plugins to load Monaco’s worker files.

Under the hood it delegates loading to the companion @monaco-editor/loader package, which fetches Monaco from a CDN or local node_modules asynchronously and caches a single shared instance. The library exposes an Editor component for single-file editing, a DiffEditor for side-by-side diffs, and a useMonaco hook for consumers that need direct access to the underlying monaco API, all with first-class TypeScript types.

What You Get

  • An Editor component with controlled/uncontrolled value modes, syntax highlighting for dozens of languages, and live validation via onValidate
  • A DiffEditor component for side-by-side original/modified comparisons using the same Monaco diff engine as VS Code
  • A useMonaco hook and loader utility for reaching the raw monaco API outside the component tree (custom languages, themes, editor commands)
  • Automatic model creation and caching per file path, plus view-state (cursor, scroll, selection) preservation when switching between multiple open models
  • Full TypeScript typings for every prop, the monaco namespace, and editor/diff-editor instances, with no separate @types package to install

Common Use Cases

  • Embedding a code editor in an internal admin tool, low-code platform, or config editor without maintaining custom webpack/rollup loader rules
  • Building an in-browser IDE or coding playground (e.g. a course platform or API sandbox) with multi-file, multi-model editing
  • Adding a JSON/YAML/SQL config editor with real-time validation markers surfaced through onValidate
  • Showing before/after diffs of generated or user-edited code (migrations, AI code suggestions, PR previews) with DiffEditor

Under The Hood

Architecture — The Editor component (src/Editor/Editor.tsx) is a thin imperative wrapper: on mount it calls loader.init() from the sibling @monaco-editor/loader package to fetch and cache a single shared monaco instance, then a useEffect gated by isMonacoMounting/isEditorReady calls createEditor() to instantiate monaco.editor.create() inside a ref’d <div> rendered by MonacoContainer (which also owns the loading placeholder and width/height sizing). Models are created or reused per file path via getOrCreateModel in src/utils/index.ts, and a module-level viewStates Map keyed by path preserves cursor/scroll/selection state across model switches. DiffEditor (src/DiffEditor/DiffEditor.tsx) follows the identical mount/create/dispose lifecycle but instantiates monaco.editor.createDiffEditor() with original/modified models. A custom useUpdate hook (vs. plain useEffect) gates every prop-driven update (options, value, language, theme, line) so none fire until isEditorReady is true, avoiding races with the async Monaco load.

Tech Stack — TypeScript (93% of the codebase), built with tsup (esbuild-based) into dual ESM/CJS bundles with generated .d.ts files; tested with Vitest, @testing-library/react, and jsdom via snapshot tests; linted with ESLint 9’s flat config plus typescript-eslint; pre-commit hooks via Husky. The only runtime dependency is @monaco-editor/loader (same author), which does the actual asynchronous fetch of the monaco-editor package from a CDN or node_modulesmonaco-editor, react, and react-dom are all peer dependencies, keeping the installed footprint small and letting consumers pin their own Monaco version.

Code Quality — Each of the four components (Editor, DiffEditor, MonacoContainer, Loading) has a co-located snapshot test, and the utility functions in src/utils/index.ts (getOrCreateModel, createModel, createModelUri) carry JSDoc comments explaining intent and parameters. Refs are used deliberately to avoid stale closures inside async callbacks (onMountRef, beforeMountRef, valueRef), and effect cleanup correctly disposes Monaco models, editor instances, and change-marker listeners. The tests themselves are shallow — mostly render-plus-snapshot rather than asserting on editor behavior — which is a real gap given how much imperative Monaco API surface (executeEdits, pushUndoStop, restoreViewState) the component manages directly.

API Design — The public surface is deliberately small: a default Editor export, a named DiffEditor, a useMonaco hook, and a re-exported loader. A working editor is a single JSX line (<Editor height="90vh" defaultLanguage="javascript" defaultValue="..." />), and prop names (defaultValue/value, defaultLanguage/language, defaultPath/path) deliberately mirror React’s own controlled/uncontrolled <input> conventions so the learning curve for React developers is near zero. Escape hatches (onMount, beforeMount) hand back the raw editor and monaco instances for anything the wrapper doesn’t cover, and the README documents every prop plus framework-specific notes (Next.js SSR, Electron) that address the most common integration friction points.

Used by 67 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

167

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
30
Repo Health
70
Technical
63
Dependency
Built with
TypeScript76%
MDX18%
Updated 1 years ago
Python
66%
Apache 2.0

Agent Control

AI Agents

295

An open-source runtime control plane for AI agents — define safety guardrails once, apply them across agents built on LangChain, CrewAI, Google ADK, or AWS Strands, and update controls without redeploying code.

View details
79
Repo Health
71
Technical
70
Dependency
Built with
Python66%
TypeScript33%
Updated yesterday
Python
99%
MIT

Agent Lightning

AI Development

17,500

A Microsoft-built training framework that optimizes AI agents with reinforcement learning, automatic prompt optimization, or supervised fine-tuning — with near-zero code changes to your existing agent, in any framework.

View details
84
Repo Health
68
Technical
69
Dependency
Built with
Python99%
Updated today
Rust
64%
Apache 2.0

agentgateway

AI Development · Developer Tools

4,420

An open source AI-native proxy that secures, observes, and governs agent-to-LLM, agent-to-tool, and agent-to-agent communication through MCP, A2A, and unified LLM routing.

View details
88
Repo Health
82
Technical
72
Dependency
Built with
Rust64%
Go24%
Updated yesterday
Python
86%
MIT

ai-toolkit

AI Development · AI Design Tools

11,757

An all-in-one open-source training suite for finetuning diffusion models—FLUX, SDXL, Wan video, and audio—on consumer GPU hardware via CLI or web UI.

View details
77
Repo Health
66
Technical
75
Dependency
Built with
Python86%
TypeScript13%
Updated 2 days ago
TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

32,102

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
88
Repo Health
76
Technical
66
Dependency
Built with
TypeScript95%
Updated today
Python
90%
Apache 2.0

Apache Airflow

Data Engineering

46,530

Define, schedule, and monitor complex data workflows as Python code — with a powerful UI, 80+ provider integrations, and battle-tested scalability across thousands of production deployments.

View details
96
Repo Health
89
Technical
66
Dependency
Built with
Python90%
Updated today
TypeScript
96%
Other

Amplication

Developer Tools · AI Code Assistants · Automation

16,010

Create production-ready backend services with your organization's standards baked in — generating NestJS, Prisma, and GraphQL code that you own and control.

View details
61
Repo Health
84
Technical
60
Dependency
Built with
TypeScript96%
Updated 1 months ago
Rust
86%
Other

Arroyo

Data Engineering · Analytics

5,005

A distributed stream processing engine written in Rust that lets you write SQL to run stateful, real-time computations over data streams with subsecond results.

View details
86
Repo Health
74
Technical
62
Dependency
Built with
Rust86%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search