Do I need to build a Portable Text editor from scratch?

1 replyLast updated: Dec 1, 2025

So if I understand correctly, Portable Text was published as an open standard, with some open source tools to convert Portable Text to other formats. But if I wanted build a rich text editor that spits out Portable Text, I have to write that from scratch, correct?
AI Update

Good news - you don't have to build everything from scratch! While the Portable Text specification itself is published as an open standard, there are also open-source editor components you can use.

The @portabletext/editor package is available on npm and provides the core editing functionality for creating Portable Text. This is the modern, actively maintained editor package that powers the rich text editing experience in Sanity Studio.

Important context:

The editor is primarily designed for use within the Sanity ecosystem, so using it standalone requires some integration work:

Alternative approaches to consider:

The broader ecosystem:

For rendering Portable Text (not editing), there are well-maintained libraries like @portabletext/react and similar packages for other frameworks. Tools like @sanity/block-tools help convert HTML and other formats into Portable Text.

So while you can build an editor that outputs Portable Text using the open-source packages, it's definitely more straightforward within the Sanity ecosystem where all the pieces integrate seamlessly. If you're building a custom CMS or editing interface, @portabletext/editor is your starting point, but expect to do significant integration work.

Show original thread
1 reply

Was this answer helpful?

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Related contributions