Menu

1 / 5

How to Build a shadcn Markdown Editor in React

DEV Community: tutorial·Abdullah Mukadam·4 days ago
#FPOz7a3r
#devtotutorial#devto#dev#markdown#editor
Reading 0:00
15s threshold

Most apps that store markdown still don't want users typing ** and ## by hand. Writers expect a formatted editor, while your database, API, or Git repo expects plain markdown.

This guide builds a markdown editor for a shadcn/ui app that gives you both. Users edit formatted text, and you load and save markdown. It uses editorcn , a set of Tiptap editors installed with the shadcn CLI, and its Markdown extension .

Try it live: interactive demo of the markdown extension in the toolbar editor on the editorcn blog.

In this guide you'll:

Install the editor and the Markdown extension

Load a markdown string into the editor

Save the content back as markdown

Turn pasted markdown into formatted text

Add import, export, and copy buttons

Render markdown read-only on the server

Two kinds of markdown editor

When people search for a markdown editor, they usually mean one of two things:

Split view : a textarea on the left and a rendered preview on the right.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.