Skip to content

Introduction

notectl is a rich text editor shipped as a native Web Component (<notectl-editor>). It is designed from the ground up with a strict layered architecture, immutable data structures, a powerful plugin system, and comprehensive accessibility support.

notectl editor with formatted content

  • Web Component — Works in any framework (React, Vue, Angular, Svelte) or plain HTML
  • Plugin-based — Every feature is a plugin. Use only what you need.
  • Immutable State — All state changes are expressed as invertible transactions with step-based history
  • Declarative Toolbar — Configure toolbar layout with a simple array-of-arrays syntax
  • Custom Fonts — Load WOFF2/TTF/OTF fonts with automatic @font-face injection
  • Tables — Full table support with cell selection, row/column operations
  • Accessible — ARIA roles, screen reader announcements, keyboard navigation throughout
  • Type-safe — Written in strict TypeScript with branded types and exhaustive type guards

notectl follows a unidirectional data flow:

User Input → Transaction (Steps) → Middleware → New State → DOM Reconciliation

Every change creates a Transaction containing one or more Steps. Steps are atomic, invertible operations (insert text, add mark, split block, etc.). The transaction passes through a middleware chain, then produces a new immutable EditorState. The view layer diffs the old and new state and patches the DOM at block granularity.

This architecture gives you:

  • Predictable updates — state is always consistent
  • Built-in undo/redo — every step can be inverted
  • Plugin interception — middleware can modify or cancel transactions
  • Easy testing — state transitions are pure functions
LayerResponsibility
ModelImmutable data types: Document, BlockNode, TextNode, InlineNode, Mark, Selection
StateEditorState container, Transaction builder, History manager
ViewDOM reconciliation, selection sync, input handling
CommandsHigh-level operations: toggleMark, splitBlock, deleteBackward
PluginsFeature modules that register schema, commands, keymaps, toolbar items

Full toolbar with all plugins

notectl ships with 18 built-in plugins covering text formatting, headings, lists, tables, links, code blocks, images, fonts, text color, alignment, highlight, superscript/subscript, and more. See the Plugin Overview for the full list.

Table showcase

List content