-
Notifications
You must be signed in to change notification settings - Fork 2
Getting Started
neikiri edited this page May 19, 2026
·
21 revisions
Get Neiki's Editor running in your project in under 2 minutes.
One line. CSS is bundled automatically. Always loads the latest version:
<script src="https://cdn.neikiri.dev/neiki-editor/neiki-editor.min.js"></script><script src="https://cdn.neikiri.dev/neiki-editor/3.0.2/neiki-editor.min.js"></script><!-- Latest -->
<link rel="stylesheet" href="https://cdn.neikiri.dev/neiki-editor/neiki-editor.css">
<script src="https://cdn.neikiri.dev/neiki-editor/neiki-editor.js"></script>
<!-- Pinned to 3.0.2 -->
<link rel="stylesheet" href="https://cdn.neikiri.dev/neiki-editor/3.0.2/neiki-editor.css">
<script src="https://cdn.neikiri.dev/neiki-editor/3.0.2/neiki-editor.js"></script><!-- Latest -->
<script src="https://cdn.jsdelivr.net/gh/neikiri/neiki-editor@latest/dist/neiki-editor.min.js"></script>
<!-- Pinned -->
<script src="https://cdn.jsdelivr.net/gh/neikiri/neiki-editor@3.0.2/dist/neiki-editor.min.js"></script>Download the files from GitHub Releases and serve them locally:
<script src="/assets/neiki-editor.min.js"></script>npm install neiki-editor
# or
yarn add neiki-editor<?php require_once 'php/neiki-editor.php'; ?>
<head>
<?= NeikiEditor::assets() ?>
</head>Note
The PHP helper outputs both CSS and JS tags and prevents duplicate includes. See the Integration Guide for full PHP details.
<textarea id="my-editor">
<p>Hello, world!</p>
</textarea>Any HTML content inside the textarea is loaded automatically.
<script>
const editor = new NeikiEditor('#my-editor');
</script>That's it. The textarea is replaced with a full WYSIWYG editor.
Important
Always load the CSS before the JS file. The editor needs styles to render correctly during initialization.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Neiki's Editor Demo</title>
<script src="https://cdn.neikiri.dev/neiki-editor/neiki-editor.min.js"></script>
</head>
<body>
<h1>My Editor</h1>
<textarea id="editor">
<p>Start writing something amazing...</p>
</textarea>
<script>
const editor = new NeikiEditor('#editor', {
placeholder: 'Type here...',
minHeight: 400,
theme: 'light',
onChange: function(content) {
console.log('Content changed!');
}
});
</script>
</body>
</html>The editor can be attached to different element types:
<textarea id="editor"></textarea>
<script>new NeikiEditor('#editor');</script><div id="editor"><p>Existing content</p></div>
<script>new NeikiEditor('#editor');</script>const element = document.getElementById('editor');
const editor = new NeikiEditor(element);const editor1 = new NeikiEditor('#editor-1', { theme: 'light' });
const editor2 = new NeikiEditor('#editor-2', { theme: 'dark', minHeight: 200 });Retrieve the edited content for saving or processing:
// Get HTML string
const html = editor.getContent();
// Get plain text (no HTML tags)
const text = editor.getText();
// Check if editor is empty
const empty = editor.isEmpty();
// Get structured JSON
const json = editor.getJSON();<form id="my-form">
<textarea id="editor"></textarea>
<button type="submit">Save</button>
</form>
<script>
const editor = new NeikiEditor('#editor');
document.getElementById('my-form').addEventListener('submit', function(e) {
e.preventDefault();
const content = editor.getContent();
// send content to your backend...
});
</script>const editor = new NeikiEditor('#editor', {
onChange: function(content) {
document.getElementById('preview').innerHTML = content;
}
});| βοΈ Configuration | Customize every aspect of the editor |
| π§ Toolbar Reference | See all 30+ toolbar buttons |
| π API Reference | All methods and callbacks |
| π Integration Guide | PHP, Vue.js, React examples |
Getting Started
Reference
Extending
Integration
Features & UI
Project