code-mirror-custom-element
v1.0.12
Published
CodeMirror 6 as a custom element (web component)
Downloads
449
Readme
CodeMirror Custom Element
CodeMirror 6 as a custom element (web component)
Install
npm i code-mirror-custom-element
Usage:
import 'code-mirror-custom-element'
<code-mirror lang="javascript" value="let a = 10;" autofocus></code-mirror>
To use in browser, without npm:
Download dist/code-mirror-custom-element.js
In your html file, add:
<script type="module" src="code-mirror-custom-element.js"></script>
<code-mirror lang="javascript" value="let a = 10;" autofocus></code-mirror>
And you're done.
Caveats:
Supported languages are "javascript", "html" and "css". Please create an issue in github to add support for the language you want.