Home

Awesome

@alkhipce/editorjs-react

Demo

https://editorjs-react.vercel.app/

Installation

npm i @alkhipce/editorjs-react

Usage

// import Parser component or import certain component like this (available components list below)
import { Parser, Table } from '@alkhipce/editorjs-react';

const App = () => {
  return (
    <>
      <Parser data={EDITORJS_DATA} />
      <Table content={EDITORJS_DATA} withHeadings={false} />;
    </>
  );
};

Available components

Code

PropsDescriptionTypeDefault
codedisplay code in preformatted stylestring-

Delimiter

PropsDescriptionTypeDefault
----

Header

PropsDescriptionTypeDefault
levelheading text levelnumber (1-6)1
textyour textstring-

Image

PropsDescriptionTypeDefault
filecontains image infoobject with field url: string;-
captionimage captionstring or undefined-
withBorderadd border around imageboolean or undefinedfalse
stretchedstretch imageboolean or undefinedfalse
withBackgroundadd image backgroundboolean or undefinedfalse

List

PropsDescriptionTypeDefault
itemslist itemsstring array[]
styleset ordered or unordered list style'ordered' or 'unordered' string'unordered'

Paragraph

PropsDescriptionTypeDefault
textyour textstring-

Quote

PropsDescriptionTypeDefault
textyour textstring-
captionquote captionstring-
alignmentset quote alignment'left' or 'center' string'left'

RawTool

PropsDescriptionTypeDefault
htmlyour codestring-

Table

PropsDescriptionTypeDefault
contenttable datastring[][]-
withHeadingsadd table headingsbooleanfalse