Skip to main content
Tiptap can be used directly with vanilla JavaScript without any framework. This is useful for projects that don’t use a framework or when you want full control over the integration.

Installation

1

Install the core package

Install the core package and any extensions you need:
2

Import and use

Import the Editor class and extensions in your JavaScript:

Core Concepts

Editor Class

The Editor class is the core of Tiptap. It manages the editor state, extensions, and view.

Type Signature

Basic Usage

Here’s a minimal example of creating an editor:

HTML Structure

Complete Working Examples

Working with Content

Getting Content

Setting Content

Commands

Tiptap provides a powerful command system:

Check Active States

Event Handling

Toolbar Example

Here’s a complete example with a toolbar:

Advanced: Custom Extensions

Create custom extensions in vanilla JavaScript:

Cleanup

Always destroy the editor when it’s no longer needed:

Using with Build Tools

Next Steps

Extensions

Explore available extensions to enhance your editor

Commands

Learn about all available commands

Editor API

Full reference for the Editor class

Custom Extensions

Build your own extensions