Basic API examples for the Bootstrap 5 vanilla build

These pages translate the old jQuery snippets from 02-basic-api.html to the current public API: summernote.create(), summernote.invoke(), summernote.getInstance(), and summernote.interface.

Content Commands

Initialize the editor, insert text, read HTML, and step through undo/redo.

Editor State

Focus, disable, enable, reset, and check whether the editor is empty.

Selection and Range

Inspect createRange and compare saveRange with restoreRange.

View Modes

Toggle CodeView and fullscreen and read the current fullscreen state.

Instance Lifecycle

Read summernote.interface, inspect the active instance, and destroy or recreate it.

Writing Aids

Compare spellCheck and disableGrammar on the editable surface.