DEV Community

MD Taseen Khan
MD Taseen Khan

Posted on • Originally published at reactjsexample.com on

1

React Markdown Editor with real-time preview

Markdown Editor with React and Tailwind CSS

React Markdown Editor with real-time preview

This Markdown editor built with React and Tailwind CSS allows users to write, edit, and preview markdown in real-time. It features a split view with an editor and a previewer.

Project Structure

The project consists of the following main components:

1. App Component (App.tsx)

  • Manages the state for the current tab (Editor/Previewer) and the markdown code.
  • Uses the Editor, Head, and Previewer components.

2. Editor Component (Editor.tsx)

  • Renders a textarea for markdown editing.
  • Communicates with the parent App component to update the markdown code.

3. Head Component (Head.tsx)

  • Provides the header with tab-switching functionality between Editor and Previewer.
  • Manages the current active tab and communicates with the parent App component.

4. Previewer Component (Previewer.tsx)

  • Renders a preview of the markdown using ReactMarkdown and remark-gfm for GitHub-flavored markdown.

Getting Started

  1. Clone the repository.
  2. Install dependencies with npm install.
  3. Run the app with npm run start.

Technologies Used

  • React
  • Tailwind CSS
  • ReactMarkdown
  • remark-gfm (GitHub-flavored markdown)

Preview

React Markdown Editor with real-time preview React Markdown Editor with real-time preview React Markdown Editor with real-time preview React Markdown Editor with real-time preview

GitHub

View Github

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

AWS Security LIVE!

Hosted by security experts, AWS Security LIVE! showcases AWS Partners tackling real-world security challenges. Join live and get your security questions answered.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️