React code editor libraries

Updated Nov 2026

React code editor libraries embed a code editing surface with syntax highlighting in a React application. Most wrap an existing editor engine such as Monaco, CodeMirror, or Ace and expose its instance through props and callbacks. These libraries let developer tools, playgrounds, and admin consoles accept code from users.

Popularity

@monaco-editor/react has the most monthly downloads in this comparison, at 38.6M.

LibraryMonthly downloadsStarsLast releaseLicense
@monaco-editor/react
38.6M
4.8KFeb 2025MIT
@uiw/react-codemirror
27.3M
2.3KSep 2026MIT
@codesandbox/sandpack-react
6.6M
6.3KFeb 2025Apache-2.0
react-simple-code-editor
5.3M
1.7KJul 2024MIT
react-ace
3.5M
4.2KJul 2026MIT
react-live
2.6M
4.6KOct 2026MIT
react-codemirror2
1.7M
1.7KOct 2025MIT
react-monaco-editor
1.3M
4.2KJul 2025MIT
Downloads: npm, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Features compared

LibraryDiff editor componentRunning code previewFile explorer component
@monaco-editor/reactBuilt-inUnsupportedUnsupported
@uiw/react-codemirrorUnsupportedUnsupportedUnsupported
@codesandbox/sandpack-reactUnsupportedBuilt-inBuilt-in
react-simple-code-editorUnsupportedUnsupportedUnsupported
react-aceBuilt-inUnsupportedUnsupported
react-liveUnsupportedBuilt-inUnsupported
react-codemirror2UnsupportedUnsupportedUnsupported
react-monaco-editorBuilt-inUnsupportedUnsupported
Built-inNot supported

Libraries and code examples

@monaco-editor/react

Embeds Monaco editors with React props, model paths, and native editor callbacks.

Downloads / mo
38.6M
Stars
4.8K
Last release
4.7.0
License
MIT

Strengths

  • Preserves models between files. Switch path to restore a file’s model and view state.
  • Exposes the native editor. Use onMount to retain the editor instance for later commands.

Limitations

  • Loads engine files remotely. Configure local Monaco files when the default CDN is unavailable.
  • Hook initialization is asynchronous. Wait for useMonaco to return an instance before calling editor APIs.

Quickstart

From README.md
$ npm install @monaco-editor/react
import Editor from '@monaco-editor/react';

export default function App() {
  return <Editor height="300px" defaultLanguage="javascript" defaultValue="// hello" />;
}

@monaco-editor/react examples

From open-source projects on GitHub

@uiw/react-codemirror

Embeds CodeMirror with React state, extension configuration, and native editor callbacks.

Downloads / mo
27.3M
Stars
2.3K
Last release
4.25.12
License
MIT

Strengths

  • Exposes native editor state. Use onCreateEditor to access the editor view and state.
  • Restores serialized editor state. Use initialState to restore saved editor state, including configured history fields.

Limitations

  • Changing extensions triggers costly rerenders. Memoize dynamic extensions to keep their references stable.

Quickstart

From README.md
$ npm install @uiw/react-codemirror
import { useState } from 'react';
import CodeMirror from '@uiw/react-codemirror';

export default function App() {
  const [code, setCode] = useState('hello');
  return <CodeMirror value={code} height="200px" onChange={setCode} />;
}

@uiw/react-codemirror examples

From open-source projects on GitHub

@codesandbox/sandpack-react

Provides the Sandpack React components from CodeSandbox.

Downloads / mo
6.6M
Stars
6.3K
Last release
2.20.0
License
Apache-2.0

Quickstart

From README.md
$ npm install @codesandbox/sandpack-react
import { Sandpack } from '@codesandbox/sandpack-react';

export default function App() {
  return <Sandpack template="react" />;
}

@codesandbox/sandpack-react examples

From open-source projects on GitHub

react-simple-code-editor

Provides a controlled code input with an application-supplied syntax highlighter.

Downloads / mo
5.3M
Stars
1.7K
Last release
0.14.1
License
MIT

Strengths

  • Works as a controlled input. Pass value and update it through onValueChange.
  • Allows keyboard users to escape. Set ignoreTabKey or use the shortcut to stop capturing Tab.

Limitations

  • Slows down with large documents. Large documents can reduce typing speed.
  • Mixed font styles misalign text. Keep highlighted text aligned with the underlying textarea.

Quickstart

From README.md
$ npm install react-simple-code-editor prismjs
import { useState } from 'react';
import Editor from 'react-simple-code-editor';
import { highlight, languages } from 'prismjs/components/prism-core';
import 'prismjs/components/prism-clike';
import 'prismjs/components/prism-javascript';
import 'prismjs/themes/prism.css';

export default function App() {
  const [code, setCode] = useState('const answer = 42;');
  return <Editor value={code} onValueChange={setCode}
    highlight={value => highlight(value, languages.js)} padding={10} />;
}

react-simple-code-editor examples

From open-source projects on GitHub

Embeds Ace with React props for text, editor options, and event callbacks.

Downloads / mo
3.5M
Stars
4.2K
Last release
15.0.0
License
MIT

Strengths

  • Exposes native editor commands. Use the component’s editor property to run Ace commands.
  • Adds custom keyboard commands. Pass commands with key bindings and their event handlers.

Limitations

  • Autocomplete needs an extension. Import language_tools before enabling completions or snippets.

Quickstart

From README.md
$ npm install react-ace ace-builds
import AceEditor from 'react-ace';
import 'ace-builds/src-noconflict/mode-java';
import 'ace-builds/src-noconflict/theme-github';

export default function App() {
  return <AceEditor mode="java" theme="github" name="code-input"
    defaultValue="// hello" width="100%" height="200px" />;
}

react-ace examples

From open-source projects on GitHub
public componentDidMount(): void {
  if (this.props.autofocus) {
    const { editor } = this.editorRef.current as any;
    editor.focus();
    editor.navigateFileStart();
  }
}

Provides a production-focused playground for live editing React code.

Downloads / mo
2.6M
Stars
4.6K
Last release
5.0.1
License
MIT

Quickstart

From README.md
$ npm install react-live
import { LiveProvider, LiveEditor, LivePreview } from 'react-live';

export default function App() {
  return (
    <LiveProvider code="<strong>Hello</strong>">
      <LiveEditor />
      <LivePreview />
    </LiveProvider>
  );
}

react-live examples

From open-source projects on GitHub

react-codemirror2

Wraps CodeMirror in a small React component.

Downloads / mo
1.7M
Stars
1.7K
Last release
9.0.1
License
MIT

Quickstart

From README.md
$ npm install react-codemirror2 codemirror@5
import { useState } from 'react';
import { Controlled as CodeMirror } from 'react-codemirror2';
import 'codemirror/lib/codemirror.css';

export default function App() {
  const [code, setCode] = useState('hello');
  return <CodeMirror value={code}
    onBeforeChange={(_editor, _change, value) => setCode(value)} />;
}

react-codemirror2 examples

From open-source projects on GitHub
handleChange(newValue) {
  const cursor = this.cm.doc.getCursor();
  const selections = this.cm.doc.listSelections();
  this.setState({ lastKnownValue: newValue });
  this.props.onChange(this.toValue('code', newValue), { cursor, selections });
}

react-monaco-editor

Provides Monaco Editor for React.

Downloads / mo
1.3M
Stars
4.2K
Last release
0.59.0
License
MIT

Quickstart

From README.md
$ yarn add react-monaco-editor
import MonacoEditor from 'react-monaco-editor';

export default function App() {
  return <MonacoEditor height="300" language="javascript" value="// hello" />;
}

react-monaco-editor examples

From open-source projects on GitHub

FAQ

@monaco-editor/react suits multi-file editors that keep a model and view state for each path. @uiw/react-codemirror suits CodeMirror editors configured through extensions. react-simple-code-editor suits small controlled inputs with an application-supplied highlighter.

react-live provides a production-focused playground for live editing React code.

react-ace embeds Ace with React props for text, editor options, and event callbacks. Autocomplete needs the language_tools extension imported first.

@monaco-editor/react embeds Monaco editors with React props and native editor callbacks. It loads its engine files from a CDN unless local files are configured.

For coding agents

Found your code editor library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official