infi-editor
v1.0.2
Published
A lightweight, dependency-free web component rich text editor.
Maintainers
Readme
InfiEditor
A lightweight, dependency-free web component rich text editor that loads libraries via CDN.
Installation
npm install infi-editorUsage
Import the script as a module:
import 'infi-editor';Configuration(Optional)
const configure = {
darkMode: true,
initialContent: sample,
focusMode: true,
onSaved: () => {
console.log('Content Saved');
},
afterInit: (editor) => {
console.log('Editor Initialized');
}
}
document.addEventListener('DOMContentLoaded', () => {
editor = document.getElementById('editor');
editor.configure(configure);
});Or via script tag:
<script type="module" src="node_modules/infi-editor/index.js"></script>Then use the component in your HTML:
<infi-editor id="editor"></infi-editor>The editor automatically loads its dependencies (Tailwind, CodeMirror, etc.) from CDNs.
