Skip to main content

API Reference

<SchemaEditor /> Props

PropTypeDefaultDescription
valuestringrequiredThe editor content
onChange(value: string) => voidCalled when content changes
language"json" | "yaml" | "javascript"requiredContent language
schemaJsonSchemaJSON Schema driving completion and diagnostics (json/yaml)
snippetsstring[]Snippet strings for JavaScript ghost completion
theme"light" | "dark""light"Visual theme
readOnlybooleanfalseDisable editing
placeholderstringPlaceholder text when empty
showDiagnosticsbooleantrueShow diagnostics status bar
enableInlineSuggestionsbooleantrueEnable ghost text
enableCompletionbooleantrueEnable popup completion
diagnosticsDebounceMsnumber250Diagnostics debounce delay

Core exports (@powerduck/schema-editor)

FunctionDescription
resolveSchemas(document)Resolve $ref pointers in a schema document
validateSchema(data, schema)Validate data against a schema
generateSample(schema)Generate example data from a JSON Schema
getCompletionItems(model, position)Get completion items at a cursor position

Types

import type { SchemaEditorProps } from "@powerduck/schema-editor/react";