0.0.2 • Published 7 months ago

prosemirror-react-renderer v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Prosemirror React Renderer

Customizable and lightweight library for rendering ProseMirror compatible JSON schema as React components.

Usage

npm install "prosemirror-react-renderer"
import { RichText } from "prosemirror-react-renderer";

<RichText>
  {{
    content: [
      {
        content: [
          {
            text: "hello ",
            type: "text",
          },
          {
            marks: [{ type: "bold" }],
            text: "world!",
            type: "text",
          },
        ],
        type: "paragraph",
      },
    ],
    type: "doc",
  }}
</RichText>;

Props

PropDescriptionDefault value
marksLookup for rendering marks. Uses marks type property as key.defaultMarkMappings (exported)
nodesLookup for rendering nodes. Uses type property as key.defaultNodeMappings (exported)
renderTextFunction allowing custom mapping of plain text values-
0.0.2

7 months ago

0.0.1

12 months ago