Skip to content

Plugin Presets

Plugin presets are factory functions that return pre-configured plugin bundles. Instead of manually instantiating 15+ plugins, you get a production-ready editor in one line.

createFullPreset() returns all standard plugins organized into 8 logical toolbar groups:

import { createEditor, createFullPreset, ThemePreset } from '@notectl/core';
const editor = await createEditor({
...createFullPreset(),
theme: ThemePreset.Light,
placeholder: 'Start typing...',
});
document.getElementById('app').appendChild(editor);

This gives you the same setup as manually configuring:

GroupPluginsPurpose
1Font, FontSizeTypography
2TextFormatting, Strikethrough, SuperSubInline marks
3TextColor, HighlightColors
4Heading, Blockquote, CodeBlockBlock types
5AlignmentParagraph layout
6ListBullet, ordered, checklist
7Link, Table, HorizontalRule, ImageInsert objects
8PrintUtility

HardBreakPlugin is included in the non-toolbar plugins array (it registers Shift+Enter but needs no toolbar button).

createMinimalPreset() returns a lightweight editor with only font selection:

import { createEditor, createMinimalPreset } from '@notectl/core';
const editor = await createEditor({
...createMinimalPreset(),
placeholder: 'Start typing...',
});

The editor still has bold/italic/underline (via auto-registered TextFormattingPlugin) and keyboard navigation (auto-registered CaretNavigationPlugin and GapCursorPlugin).

Both presets accept an optional options object to override individual plugin configs:

const editor = await createEditor({
...createFullPreset({
list: { interactiveCheckboxes: true },
heading: { levels: [1, 2, 3] },
fontSize: { sizes: [12, 14, 16, 20, 24, 32], defaultSize: 14 },
}),
theme: ThemePreset.Dark,
});
KeyPluginExample
fontFontPlugin{ fonts: [...STARTER_FONTS, myFont] }
fontSizeFontSizePlugin{ sizes: [12, 16, 24], defaultSize: 16 }
textFormattingTextFormattingPlugin{ bold: true, italic: true, underline: false }
strikethroughStrikethroughPlugin{ separatorAfter: true }
superSubSuperSubPlugin{ superscript: true, subscript: false }
textColorTextColorPlugin{ colors: ['#000', '#f00', '#0f0'] }
highlightHighlightPlugin{ colors: ['#ff0', '#0ff'] }
headingHeadingPlugin{ levels: [1, 2, 3] }
blockquoteBlockquotePlugin{ separatorAfter: true }
codeBlockCodeBlockPlugin{ highlighter: myHighlighter }
alignmentAlignmentPlugin{ alignments: ['left', 'center', 'right'] }
listListPlugin{ interactiveCheckboxes: true }
linkLinkPlugin{ openInNewTab: true }
tableTablePlugin{ maxPickerRows: 10 }
horizontalRuleHorizontalRulePlugin{ separatorAfter: true }
imageImagePlugin{ uploadService: myUploader }
printPrintPlugin{ keyBinding: 'Mod-Shift-P' }

Presets return a PresetConfig object with toolbar and plugins arrays. You can extend them:

import { createFullPreset } from '@notectl/core';
import { MyCustomPlugin } from './MyCustomPlugin';
const preset = createFullPreset();
const editor = await createEditor({
toolbar: [...preset.toolbar, [new MyCustomPlugin()]],
plugins: [...preset.plugins, myAnalyticsPlugin],
placeholder: 'Start typing...',
});

Use presets when you want a standard editor quickly. Use manual toolbar configuration when you need full control over which plugins appear, their ordering, or group composition.

PresetManual
Lines of code1-315-30
Plugin selectionAll or overridePick exactly what you need
Toolbar group orderFixedCustom
Best forQuick setup, prototyping, standard editorsCustom layouts, subset of plugins