0.2.3 • Published 4 months ago

contenty-editor v0.2.3

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

Contenty Editor

This has been built using editor.js and several of its plugins for use in react.js based project.

Installation

First, install this package to your project

yarn add contenty-editor

Install the required dependencies

yarn add  @editorjs/editorjs  @editorjs/header  @editorjs/paragraph  @editorjs/quote  @editorjs/warning  editorjs-alert  @editorjs/nested-list  @editorjs/checklist  @editorjs/code  @calumk/editorjs-columns  @editorjs/table  editorjs-break-line  @editorjs/link  @editorjs/embed  @editorjs/simple-image  axios  framer-motion

Usage

Add the editor.css file to your project. (In next.js project you need to add it in the pages/_app.tsx file)

import 'contenty-editor/src/ContentyEditor/css/editor.css';

Import the ContentyEditor component and use it to your application

import ContentyEditor from 'contenty-editor';
import EditorJS from '@editorjs/editorjs';

const App = () => {
  const editorRef = useRef<EditorJS>()
  return (
    <ContentyEditor
      editorRef={editorRef}
      mandatoryControls={[]} // An array of mandatory controls
      optionalControlTypes={ []} // An array of optional controls
    />
  );
};

Props

FieldTypeDescription
editorRefMutableRefObject<EditorJS>Holds a reference to the editor
mandatoryControlsIMandatoryControl[]Controls for adding new blocks, hidden for certain conditions
optionalControlTypesstring[]Available control types in the editor toolbox
initialDataOutputDataGenerates initial blocks based on editor data
themeColorsIEditorColorsFor changing theme colors
editorToolConfigIETConfigTool configurations used within the editor tools
0.2.3

4 months ago

0.2.1

5 months ago

0.2.2

5 months ago

0.1.9

6 months ago

0.1.8

6 months ago

0.1.7

6 months ago

0.1.6

6 months ago

0.1.5

6 months ago

0.1.4

6 months ago

0.1.2

6 months ago

0.1.1

6 months ago