Skip to content
This repository has been archived by the owner on Jan 7, 2020. It is now read-only.

activeviam/react-resize-aware-monaco

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-resize-aware-monaco

react-resize-aware-monaco exposes Microsoft's Monaco Editor as a React Component.

This tool is not used anymore internally. Therefore, we wont' maintain nor improve it anymore. Open an issue if you want to adopt this project.

Installation

Add react-monaco to your dependencies:

npm install react-resize-aware-monaco --save-dev

Add the following to your Webpack config:

{
  plugins: [
    new CopyWebpackPlugin([
      {
        from: 'node_modules/monaco-editor/min/vs',
        to: 'vs'
      }
    ])
  ]
}

Usage

import MonacoEditor from 'react-resize-aware-monaco';

const myComponent = props => (
    <MonacoEditor
        options={}
        onChange={}
        theme={}
    />
)

Properties

  • Options : Object, default : {automaticLayout: true}
    • It is the second argument that you would have given monaco.editor.create (see playground)
    • Please note that your can use vs-dark-plus-kinda for the theme. The corresponding theme looks like VS Code's dark-plus.
  • onChange : Function, default : noop
    • The component's value is uncontrolled but you can use this property to get called back when it changes.
  • theme : Object, default : undefined
    • It is the second argument that you would have given monaco.editor.defineTheme (see playground) with a key attribute which would have been the first argument to provide to said method.

About

monaco-editor as a React Component

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published