Custom AI Editor
None

Custom AI Editor

Oct. 20, 2024

zentrum solutions

tiptap

autocomplete

Next.js

Notion

AI

text editor

Prisma

Technologies Used

Why Tiptap is Awesome

Tiptap is a modern editor built on top of ProseMirror, offering flexibility and customization. What makes it stand out is the ability to easily integrate it with modern JavaScript frameworks (like React in my case) and extend its functionality with custom extensions.

Some key features that make Tiptap ideal:

Custom AI-Powered Tiptap Extensions

For this project, I created custom extensions for Tiptap to integrate AI-powered commands using an autocompletion feature. Here’s how it works:

  1. AI Autocomplete: Users can trigger AI-powered autocompletion by hitting "Tab". The editor analyzes the surrounding text and predicts the next few words or sentences using AI (via a backend API integrated with AI models).
  2. AI Commands: I extended Tiptap to recognize certain commands (like /generate, /summarize), which trigger different AI actions, such as generating new content or summarizing a block of text.

Creating these custom extensions was made simple thanks to Tiptap's extension API, which allows you to define new keyboard shortcuts, menu items, and commands.

Notion-like Drag-and-Drop Interface

The editor also features a Notion-inspired drag-and-drop interface. Users can drag blocks (e.g., paragraphs, images, lists) and move them around, just like in Notion. This improves the user experience, making it easier to reorganize content without breaking focus.

Why we Chose Next.js and Prisma

Final Thoughts

This project showcases how modern web development tools like Next.js, Prisma, and Tiptap can come together to create a powerful, flexible text editor with advanced features like drag-and-drop interfaces and AI-powered commands. The extensibility of Tiptap, in particular, played a huge role in enabling custom AI integration.