@seine/content

React components for rendering block contents.

Usage no npm install needed!

<script type="module">
  import seineContent from 'https://cdn.skypack.dev/@seine/content';
</script>

README

Installation

Install React

yarn add react react-dom

Material UI

yarn add @material-ui/core @material-ui/icons @material-ui/styles

Usage

Rendering blocks

import { Content } from '@seine/content';

const data = [
  {
    "id": "5eec4cb7",
    "type": "page",
    "parent_id": null,
    "body": {},
    "format": {},
    "schema": null
  },
  {
    "id": "61272942",
    "type": "draft",
    "parent_id": "5eec4cb7",
    "body": {
      "blocks": [
        {
          "key": "2n1g7",
          "data": {},
          "text": "Text content",
          "type": "unstyled",
          "depth": 0,
          "entityRanges": [],
          "inlineStyleRanges": []
        }
      ],
      "entityMap": {}
    },
    "format": {},
    "schema": null
  },
]

function DataContent() {
  return <Content>{data}</Content>;
}