1.3.3 • Published 1 year ago

@c0b41/react-editor.js v1.3.3

Weekly downloads
2
License
MIT
Repository
github
Last release
1 year ago

react-editor.js

npm version

React wrapper component for Editor.js

Install

npm install --save @stfy/react-editor.js

// or Yarn

yarn add @stfy/react-editor.js

Usage

import React, { Component } from 'react'
import Editor from '@stfy/react-editor.js'

const App => (
  <>
    <Editor
        autofocus
        holderId="editorjs-container"
        excludeDefaultTools={['header']}
        onChange={(data) => console.log(data)}
        customTools={{
          header: CustomHeader
        }}
        onReady={() => console.log('Start!')}
        data={{
          "time" : 1554920381017,
          "blocks" : [
              {
                  "type" : "header",
                  "data" : {
                      "text" : "Hello Editor.js",
                      "level" : 2
                  }
              },
          ],
          "version" : "2.12.4"
        }}
      />
  </>
)

Props

NameTypeDefaultDescription
autofocusbooleantrueSet Caret to the Editor after initialisation
holderIdstringeditorjs-holderId of Element that should contain the Editor
onChangefunctionnullonChange callback
onReadyfunctionnullonReady callback
dataobjectnullPreviously saved data that should be rendered
customToolsobjectnullSet custom tools config or overwrite existed
excludeDefaultToolsarraynullExclude default tool by tool name

Default tools

NamePackage
header@editorjs/header
list@editorjs/list
inlineCode@editorjs/inlineCode
image@editorjs/image
embed@editorjs/embed
quote@editorjs/quote
marker@editorjs/marker
code@editorjs/code
link@editorjs/link
delimiter@editorjs/delimiter
raw@editorjs/raw
table@editorjs/table
warning@editorjs/warning
paragraph@editorjs/paragraph
checklist@editorjs/checklist

Contributing

Welcome to contribute.

License

MIT Licensed. License 2019

1.3.3

1 year ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

4 years ago

1.0.0

4 years ago