🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@create-markdown/react

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@create-markdown/react

React components and hooks for @create-markdown

latest
Source
npmnpm
Version
2.0.3
Version published
Maintainers
1
Created
Source

@create-markdown/react

React components and hooks for @create-markdown.

Installation

# Using pnpm
pnpm add @create-markdown/react

# Using npm
npm install @create-markdown/react

# Using yarn
yarn add @create-markdown/react

Quick Start

Render Blocks

import { BlockRenderer, useDocument, h1, paragraph } from '@create-markdown/react';

function Editor() {
  const doc = useDocument([
    h1('Welcome'),
    paragraph('Start editing...'),
  ]);
  
  return <BlockRenderer blocks={doc.blocks} />;
}

Bidirectional Markdown

import { BlockRenderer, useMarkdown } from '@create-markdown/react';

function MarkdownEditor() {
  const { markdown, blocks, setMarkdown } = useMarkdown('# Hello');
  
  return (
    <div>
      <textarea
        value={markdown}
        onChange={(e) => setMarkdown(e.target.value)}
      />
      <BlockRenderer blocks={blocks} />
    </div>
  );
}

Block Selection and Editing

import { BlockRenderer, useDocument, useBlockEditor, BlockElement } from '@create-markdown/react';

function Editor() {
  const doc = useDocument();
  const editor = useBlockEditor(doc);
  
  return (
    <div>
      {doc.blocks.map((block) => (
        <div
          key={block.id}
          onClick={() => editor.selectBlock(block.id)}
          style={{
            border: editor.selectedBlockId === block.id ? '2px solid blue' : 'none'
          }}
        >
          <BlockElement block={block} />
        </div>
      ))}
    </div>
  );
}

Components

BlockRenderer

Renders an array of blocks as React elements.

<BlockRenderer
  blocks={blocks}
  className="my-editor"
  customRenderers={{
    codeBlock: MyCustomCodeBlock,
  }}
/>

BlockElement

Renders a single block.

InlineContent

Renders inline content (text spans with styles).

Hooks

useDocument(initialBlocks?, options?)

Full document state management with CRUD operations.

useMarkdown(initialMarkdown?)

Bidirectional markdown/blocks state.

useBlockEditor(documentHook)

Block selection and editing operations.

License

MIT

Keywords

markdown

FAQs

Package last updated on 09 Apr 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts