Skip to main content

TypeScript Support

Tiptap is written in TypeScript and provides full type safety out of the box. This guide shows you how to leverage TypeScript’s features when working with Tiptap.

Editor Type

The Editor class is fully typed, providing autocomplete and type checking.

Extension Options

Define typed options for your extensions.
Source: packages/core/src/Extendable.ts:57

Node Options and Attributes

Type your node options and attributes.
Source: packages/extension-heading/src/heading.ts:6

Mark Options and Attributes

Type your mark options and attributes.
Source: packages/extension-highlight/src/highlight.ts:3

Command Types

Extend the Commands interface for type-safe commands.
Source: packages/extension-bold/src/bold.tsx:13

Storage Types

Type your extension storage.
Source: packages/extension-collaboration/src/collaboration.ts:12

Editor Options Type

Type your editor configuration.
Source: packages/core/src/types.ts:286

Generic Types

Use generic types for flexible extensions.

React Hook Types

Type-safe React hooks with Tiptap.

Utility Types

Tiptap provides useful utility types.

Type Guards

Use type guards for runtime type checking.

Strict Mode

Enable strict TypeScript checking.

Common Patterns

Useful TypeScript patterns for Tiptap.
Tiptap’s TypeScript support helps catch errors at compile time and provides excellent autocomplete in your IDE.

Next Steps

Custom Extensions

Create type-safe custom extensions

Custom Nodes

Build type-safe custom nodes