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, ThemePreset } from '@notectl/core';
import { createFullPreset } from '@notectl/core/presets';
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
5Alignment, TextDirectionCoreParagraph layout & direction
6ListBullet, ordered, checklist
7Link, Table, HorizontalRule, ImageInsert objects
8PrintUtility

HardBreakPlugin and SmartPastePlugin are included in the non-toolbar plugins array (they need no toolbar button).

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

import { createEditor } from '@notectl/core';
import { createMinimalPreset } from '@notectl/core/presets';
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{}
superSubSuperSubPlugin{ superscript: true, subscript: false }
textColorTextColorPlugin{ colors: ['#000', '#f00', '#0f0'] }
highlightHighlightPlugin{ colors: ['#ff0', '#0ff'] }
headingHeadingPlugin{ levels: [1, 2, 3] }
blockquoteBlockquotePlugin{}
codeBlockCodeBlockPlugin{ highlighter: myHighlighter }
alignmentAlignmentPlugin{ alignments: ['start', 'center', 'end'] }
textDirectionTextDirectionCorePlugin{ directableTypes: ['paragraph', 'heading'] }
listListPlugin{ interactiveCheckboxes: true }
linkLinkPlugin{ openInNewTab: true }
tableTablePlugin{ maxPickerRows: 10 }
horizontalRuleHorizontalRulePlugin{}
imageImagePlugin{ maxWidth: 600, resizable: true }
printPrintPlugin{ keyBinding: 'Mod-Shift-P' }
smartPasteSmartPastePlugin{}

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

import { createFullPreset } from '@notectl/core/presets';
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