Skip to content

delpikye-v/react-editor-z

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

react-editor-z

NPM JavaScript Style Guide downloads

A customizable React wrapper component built on top of @monaco-editor/react β€” with default JSON mode.

πŸ” JSON mode with built-in validation πŸ“¦ Access to internal editor ref


πŸš€ Live Demo

πŸ‘‰ Codesandbox Example


πŸ“¦ Installation

npm install react-editor-z
# or
yarn add react-editor-z

Import the module in the place you want to use:

import CodeEditor from "react-editor-z";

Snippet

    function App() {
      return (
        <CodeEditor
          // language="json"
          // value={value}
          // onChange={(val) => setValue(val)}
          height="240px"
        />
      );
    }

πŸ”§ Props

react-editor-z extends EditorProps from @monaco-editor/react.

Prop Type Description
readOnly boolean If true, the editor will be in read-only mode.
rawJson boolean If true, raw JSON is returned in onChange even if invalid.
style React.CSSProperties Inline styles applied to the editor container.
getRefs (refsEditor: React.MutableRefObject<any>) => any Callback to access internal editor refs.
onChange (value?: string | any, error?: boolean) => any Called on content change; includes error flag if JSON parsing fails.

RUN

LIVE EXAMPLE


πŸ“ License

MIT

About

A customizable wrapper component built on top of @monaco-editor/react. JSON

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published