— MIT Licensed — React Component

Schema-Aware Monaco Editor for React

Drop-in React component that turns any JSON Schema into a guided editing experience. Ghost text, enum dropdowns, property completion, and real-time diagnostics — for JSON, YAML, and JavaScript documents.

$npm install @powerduck/schema-editor
React ComponentJSON / YAML / JSJSON Schema DrivenGhost TextDiagnostics
Quick Start

Use it in your React app in minutes

import { useState } from "react";
import { SchemaEditor } from "@powerduck/schema-editor/react";

function App() {
  const [value, setValue] = useState('{"name": ""}');

  return (
    <SchemaEditor
      value={value}
      onChange={setValue}
      language="json"
      theme="dark"
    />
  );
}
Features

What you get as a developer

02

Ghost Text Completion

Gray inline suggestions predict the next property from your JSON Schema. Press Tab to accept. Works for required fields, known keys, and enum values.

03

Popup Completion

Intellisense dropdowns show available properties. Filtered by current scope — already-used keys are excluded to prevent duplicates.

04

Live Diagnostics

Type errors, missing required fields, and invalid enums are underlined instantly. Toggle the status bar via showDiagnostics.

05

Three Languages

JSON for configs, YAML for OpenAPI docs, and JavaScript for schema authoring. Switch the language prop — the same schema drives all three.

06

Dark & Light Themes

Pass theme="dark" or theme="light". Matches your app design system via the CSS variable interface.

Props

SchemaEditor Props

All props accepted by the React component.

PropTypeDefaultDescription
value requiredstringCurrent editor content (controlled)
onChange(value: string) => voidCalled on every content change
language required"json" | "yaml" | "javascript"Content language. Determines parser and completion model.
schemaJsonSchemaJSON Schema driving completion, enum dropdowns, and diagnostics.
theme"light" | "dark""light"Editor color theme.
readOnlybooleanfalseDisable editing. Useful for view-only mode.
placeholderstringPlaceholder text shown when value is empty.
showDiagnosticsbooleantrueShow the diagnostics status bar at the bottom.
enableCompletionbooleantrueEnable popup completion suggestions.
enableInlineSuggestionsbooleantrueEnable ghost text (inline gray suggestions).
diagnosticsDebounceMsnumber250Debounce delay in milliseconds before running diagnostics.
onDiagnostics(diagnostics: Diagnostic[]) => voidCalled whenever diagnostics change. Use to show errors outside the editor.
optionsMonaco optionsExtra Monaco editor options passed through.
styleCSSPropertiesInline styles applied to the root container.
classNamestringCSS class applied to the root container.
15
Props
3
Languages
0.2.7
Version
MIT
License