A low-level Monaco Editor wrapper that provides direct access to an editor instance and API.
nve-monaco-editor is only intended for advanced use cases. Elements provides no API stability guarantees for the direct access to the Monaco Editor API provided here, as the API changes at the pace of this third-party dependency.Start with
nve-monaco-input for most use cases.Installation
import '@nvidia-elements/monaco/editor/define.js';
<nve-monaco-editor></nve-monaco-editor>
<script type="module">
const editor = document.querySelector("nve-monaco-editor");
editor.addEventListener("ready", (event) => {
const { editor, monaco } = event.target;
const model = monaco.editor.createModel("Hello World!", "plaintext");
editor.setModel(model);
});
</script>
Release Status
All elements and features go through 3 phases of stability, pre-release, beta and stable.