Package Exports
- @notectl/core
- @notectl/core/fonts
- @notectl/core/full
- @notectl/core/html
- @notectl/core/plugins/alignment
- @notectl/core/plugins/blockquote
- @notectl/core/plugins/caret-navigation
- @notectl/core/plugins/code-block
- @notectl/core/plugins/font
- @notectl/core/plugins/font-size
- @notectl/core/plugins/gap-cursor
- @notectl/core/plugins/hard-break
- @notectl/core/plugins/heading
- @notectl/core/plugins/highlight
- @notectl/core/plugins/horizontal-rule
- @notectl/core/plugins/image
- @notectl/core/plugins/link
- @notectl/core/plugins/list
- @notectl/core/plugins/print
- @notectl/core/plugins/shared
- @notectl/core/plugins/smart-paste
- @notectl/core/plugins/strikethrough
- @notectl/core/plugins/super-sub
- @notectl/core/plugins/table
- @notectl/core/plugins/text-color
- @notectl/core/plugins/text-direction
- @notectl/core/plugins/text-direction-advanced
- @notectl/core/plugins/text-formatting
- @notectl/core/plugins/toolbar
- @notectl/core/presets
- @notectl/core/presets/full
- @notectl/core/presets/minimal
Readme
notectl
Drop one tag. Get a full editor.
<notectl-editor> — the rich text editor that works everywhere.
React, Vue, Angular, Svelte, or plain HTML. Zero config, full power.
Quick Start
npm install @notectl/corePreset — full editor in 5 lines
import { createEditor, createFullPreset, ThemePreset } from '@notectl/core';
const editor = await createEditor({
...createFullPreset(),
theme: ThemePreset.Light,
placeholder: 'Start typing...',
});
document.body.appendChild(editor);All 19 plugins, toolbar groups, and keyboard shortcuts — ready to go.
Custom — pick exactly what you need
import {
createEditor,
ThemePreset,
TextFormattingPlugin,
HeadingPlugin,
ListPlugin,
LinkPlugin,
TablePlugin,
} from '@notectl/core';
const editor = await createEditor({
theme: ThemePreset.Light,
toolbar: [
[new TextFormattingPlugin({ bold: true, italic: true, underline: true })],
[new HeadingPlugin()],
[new ListPlugin()],
[new LinkPlugin(), new TablePlugin()],
],
placeholder: 'Start typing...',
autofocus: true,
});
document.body.appendChild(editor);Why notectl
|
CSP-compliant — zero inline styles The only editor with a built-in CSP-safe rendering pipeline. All styles go through |
One dependency The entire editor — state engine, reconciler, plugin system, toolbar, undo/redo, selection sync — is built from scratch with a single production dependency (DOMPurify for HTML sanitization). Tree-shakeable plugin architecture: bundle only what you use. |
|
True Web Component Shadow DOM encapsulation, reactive attributes, framework-agnostic by design. One |
Plugin system with full lifecycle Dependency-resolved initialization (topological sort), per-plugin teardown tracking, type-safe inter-plugin services via |
Plugin Ecosystem
Every capability is a plugin. Compose exactly the editor you need.
| Plugin | What you get |
|---|---|
| TextFormattingPlugin | Bold, italic, underline |
| StrikethroughPlugin | |
| SuperSubPlugin | Superscript and subscript |
| HeadingPlugin | H1 – H6 headings with block type picker |
| BlockquotePlugin | Block quotes |
| ListPlugin | Bullet, ordered, and checklists |
| LinkPlugin | Hyperlink insertion and editing |
| TablePlugin | Full table support with row/column controls |
| CodeBlockPlugin | Code blocks with syntax highlighting |
| ImagePlugin | Image upload, resize, and drag-and-drop |
| TextColorPlugin | Text color picker |
| HighlightPlugin | Text highlighting / background color |
| AlignmentPlugin | Left, center, right, justify |
| FontPlugin | Font family selection with custom web fonts |
| FontSizePlugin | Configurable font sizes |
| HorizontalRulePlugin | Horizontal dividers |
| PrintPlugin | Print editor content with configurable paper sizes |
See the plugin documentation for configuration and examples.
Built-in Features
- Themes — Dark and Light presets, or create fully custom themes
- i18n — 8 languages: English, German, Spanish, French, Chinese, Russian, Arabic, Hindi + auto-detect via
Locale.BROWSER - Paper sizes — DIN A4, DIN A5, US Letter, US Legal for WYSIWYG page layout
- CSP-compliant — Style delivery via
adoptedStyleSheets, no inline styles required - Markdown shortcuts —
#→ H1,##→ H2,-→ bullet list,1.→ ordered list,>→ blockquote - Syntax highlighting — Pluggable highlighter for code blocks
Content API
Read and write content in any format:
await editor.getContentHTML(); // export as HTML
editor.setContentHTML('<p>Hello <strong>world</strong></p>'); // import HTML
editor.getJSON(); // structured JSON
editor.setJSON(doc); // import JSON
editor.getText(); // plain text
editor.isEmpty(); // check if emptyWorks with your stack
| Framework | How | |
|---|---|---|
| Any | Vanilla JS, React, Vue, Svelte | <notectl-editor> Web Component |
| Angular | Angular 21+ | @notectl/angular native integration |
See examples/vanillajs and examples/angular for full working demos.
Contributing
git clone https://github.com/Samyssmile/notectl.git
cd notectl && pnpm install
pnpm build # build all packages
pnpm test # run unit tests
pnpm test:e2e # run e2e tests
pnpm lint # lintGet started · Open the playground · View on npm
MIT License