@liteeditor/react
v1.3.0
Published
React component for LiteEditor — the lightweight JavaScript WYSIWYG editor.
Maintainers
Readme
@liteeditor/react
React component for LiteEditor — the lightweight JavaScript WYSIWYG editor (vanilla JS, no jQuery, ~33 KB).
Install
npm install @liteeditor/react @liteeditor/editor reactUsage
import { useRef } from 'react';
import { Editor } from '@liteeditor/react';
export default function App() {
const ref = useRef(null);
return (
<>
<Editor
ref={ref}
apiKey="le_pub_your_key"
value="<p>Hello from <strong>React</strong></p>"
plugins="link lists table image"
toolbar="bold italic | link image | numlist bullist"
height={400}
onReady={(ed) => console.log('ready', ed.id)}
/>
<button onClick={() => console.log(ref.current.getContent())}>
Get HTML
</button>
</>
);
}Props
value, apiKey, apiBase, plugins, toolbar, height, onReady(editor) — plus any <textarea> attributes.
Ref methods
getContent(), setContent(html), instance().
SSR-safe: initialization is deferred to useEffect (client-only).
License
Proprietary. A free lifetime plan is available at https://liteeditor.com.
