How to Build a Text Editor Like Notion

Konstantin Münster
The Startup
Published in
11 min readNov 7, 2020

--

Slash commands are a building block in Notions text editor.

Without a doubt, Notion.so is one of my favorite apps when it comes to organizing notes. I love their minimal designed text editor because it focuses your attention on the content — and not on unnecessary UI elements.

Yet it provides you a ton of powerful features that lead to a better writing experience.

For instance, the slash command is one of those features that really enhanced my writing flow. It allows you to add and style content without leaving the keyboard. Instead of clicking a UI button to add a new heading, you can just type /h1, hit ‘Enter’, and there you go.

Another cool thing about Notion is that it is a fully web-based application. Because of that, I was interested in how it was actually built — especially the text editor. In fact, I realized that it is not that difficult as I expected it to be.

In this article, we take a closer look at how a text editor like Notion works and how we can build one ourselves with React.js.

By doing this, we will discover and learn some essential frontend skills:

  • Working with the DOM and its Nodes
  • Working with Event Listeners
  • Advanced State Management

Here is how our application will look like in the end. In my opinion, a perfect…

--

--