React-Ace

A React component wrapper around the Ace code editor, with split and diff editing modes built in

Library
npm
v15.0.0
4,207 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
80 /100 Excellent
Development Activity 76
Maintenance 72
Community 72
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
76 /100 Good
Architecture 76
Code Quality 78
Innovation 68
Learning Curve 82

React-Ace wraps the battle-tested Ace code editor as an idiomatic React component, exposing its syntax highlighting, autocompletion, and validation features through simple props instead of manual DOM wiring. It ships three exports for the common editor shapes teams need: a standard single-pane AceEditor, a Split component for side-by-side panes, and a Diff component for two-way diff views, all sharing the same underlying option and event-binding logic.

Because it targets ace-builds directly (as of v8, dropping the older brace fork), consumers pull in only the modes, themes, and extensions they import, keeping bundle size predictable. The component surface covers the vast majority of Ace’s configuration through typed props (mode, theme, fontSize, setOptions, commands, markers, annotations) plus lifecycle callbacks (onChange, onValidate, onLoad, onCursorChange) that map onto Ace’s own event system, making it a drop-in choice for building code editors, config editors, and IDE-style panels inside React apps.

What You Get

  • AceEditor, the default export, for a single-pane code editor with full prop-driven configuration (mode, theme, fontSize, tabSize, autocompletion, snippets, markers, annotations)
  • Split, a side-by-side dual-pane editor built on the same option/event pipeline, useful for comparing or synchronizing two buffers
  • Diff, a two-way diff editor built on ace-builds’ diff extension plus diff-match-patch, for rendering inline code differences
  • A large set of typed lifecycle and interaction callbacks (onChange, onValidate, onCursorChange, onSelectionChange, onPaste, onCopy, onScroll, onLoad, onBeforeLoad) that mirror Ace’s native events
  • Debounced change handling via debounceChangePeriod, and SSR-safe initialization that falls back to a non-window Ace instance

Common Use Cases

  • Embedding a syntax-highlighted code editor in an internal tool, admin panel, or documentation playground
  • Building a JSON/YAML/config editor with live validation via onValidate and inline annotations
  • Rendering side-by-side or diff views of two code snippets in a code-review or version-comparison UI
  • Powering the code-input pane of an online IDE, REPL, or coding-challenge platform

Under The Hood

Architecture React-Ace centers on three top-level components (ace.tsx, split.tsx, diff.tsx) that each wire an Ace editor instance to React’s lifecycle: componentDidMount performs one-time setup (ace.edit(), binding editor options, and event listeners for change/focus/blur/copy/paste/selection/cursor/scroll), while componentDidUpdate diffs incoming props against the previous props to call only the matching Ace setter (setOption, setTheme, setFontSize, etc.) for whatever actually changed, avoiding a full editor re-render on every prop update. Shared logic — the list of bindable editorOptions/editorEvents, a debounce helper, and getAceInstance() for SSR-safe access to the ace-builds module — lives in editorOptions.ts and is imported by all three components, avoiding duplication across the editor “shapes.”

Tech Stack The library is TypeScript-first (full IAceEditorProps typing in types.ts), built with tsdown targeting dual CJS/ESM output declared via package.json’s exports map. It depends on ace-builds (the editor engine itself, replacing the older brace fork as of v8), diff-match-patch for the diff view, fast-equals for cheap prop comparison in componentDidUpdate, and prop-types for runtime validation alongside the TS types. React and react-dom are peer dependencies spanning 0.13 through 19, reflecting the project’s maintenance history since 2014.

Code Quality Testing is substantial: tests/src/ace.spec.tsx (1059 lines) and split.spec.tsx (826 lines) use Vitest and Testing Library to cover prop updates, event callbacks, and option changes. Linting runs through oxlint rather than ESLint, and typechecking is a separate tsc --noEmit step wired into the check script. Class-based components (rather than hooks) and some loosely-typed event handlers reflect the codebase’s age, but public prop types are fully declared and naming stays consistent across all three editor components.

API Design The prop-driven API needs very little boilerplate — a single <AceEditor mode="java" theme="github" onChange={fn} /> renders a working editor, with sensible defaults (500px height/width, tabSize 4, autocompletion off) baked into defaultProps. Callback names mirror Ace’s own events 1:1 (onChange, onValidate, onCursorChange), shortening the learning curve for anyone who has touched Ace before. Escape hatches (onLoad exposing the raw editor, onBeforeLoad exposing the raw ace module) mean advanced users aren’t blocked by the prop surface, at the cost of leaking an imperative API into an otherwise declarative component.

Used by 7 apps in this directory

TypeScript
97%
Other

GrowthBook

Ab Testing Experimentation · Analytics · Developer Tools

8,446

Open source feature flags, A/B testing, and warehouse-native experimentation that queries your existing data infrastructure—no data movement required.

View details
92
Repo Health
85
Technical
63
Dependency
Built with
TypeScript 97%
Updated 1 weeks ago
Python
69%
MIT

Langflow

AI Agents · AI Development

155,319

Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.

View details
90
Repo Health
85
Technical
65
Dependency
Built with
Python 69%
TypeScript 22%
Updated 1 weeks ago
TypeScript
94%
AGPL 3.0

Laudspeaker

Automation · Marketing

2,626

Open-source customer engagement platform for building visual, event-triggered messaging journeys across email, SMS, push, in-app, and webhooks.

View details
51
Repo Health
66
Technical
62
Dependency
Built with
TypeScript 94%
Updated 3 months ago
TypeScript
97%
Other

Lightdash

Analytics · Data Engineering

6,166

The open-source Looker alternative that turns your dbt project's metrics and dimensions into governed, self-serve charts and dashboards — no license key required.

View details
93
Repo Health
84
Technical
64
Dependency
Built with
TypeScript 97%
Updated 1 weeks ago
Go
74%
Other

Notifuse

Marketing

2,223

Open-source, self-hosted alternative to Mailchimp, Brevo, and Klaviyo — send newsletters and transactional emails without per-email pricing or vendor lock-in.

View details
81
Repo Health
80
Technical
66
Dependency
Built with
Go 74%
TypeScript 23%
Updated 3 weeks ago
Python
46%
Other

Redash

Analytics · Data Engineering

28,817

Redash lets anyone connect to 35+ SQL and NoSQL data sources, write a query in the browser, and turn the result into a shared dashboard — no separate BI suite required.

View details
92
Repo Health
74
Technical
60
Dependency
Built with
Python 46%
JavaScript 30%
TypeScript 17%
Updated 1 weeks ago
TypeScript
97%
AGPL 3.0

Responsively App

Design Tools · Developer Tools

25,201

Preview and interact with your responsive web design across every device size simultaneously — no more manual resizing.

View details
78
Repo Health
71
Technical
67
Dependency
Built with
TypeScript 97%
Updated 2 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