Getting Started with KendoReact Editor

The Editor enables users to create rich textual content through a What-You-See-Is-What-You-Get (WYSIWYG) interface and delivers a set of tools for creating, editing, and formatting of text, paragraphs, lists, and other HTML elements.

The Editor component is part of the KendoReact library of React UI components. It is distributed through NPM under the kendo-react-editor package.

Basic Usage

The following example demonstrates the Editor in action.

import React from 'react';
import ReactDOM from 'react-dom';
import content from './content';
import { Editor, EditorTools } from '@progress/kendo-react-editor';

const { Bold, Italic, Underline,
    AlignLeft, AlignRight, AlignCenter,
    Indent, Outdent,
    OrderedList, UnorderedList,
    Undo, Redo, Link, Unlink } = EditorTools;

class App extends React.Component {
    render() {
        return (
            <Editor
                tools={[
                    [ Bold, Italic, Underline ],
                    [ Undo, Redo ],
                    [ Link, Unlink ],
                    [ AlignLeft, AlignCenter, AlignRight ],
                    [ OrderedList, UnorderedList, Indent, Outdent ]
                ]}
                contentStyle={{ height: 320 }}
                defaultContent={content}
            />
        );
    }
}

ReactDOM.render(
    <App />,
    document.querySelector('my-app')
);

Functionality and Features

Installation

  1. Download and install the package. Use Node.js v5.0.0 or later.

    npm install --save @progress/kendo-react-editor @progress/kendo-react-intl @progress/kendo-react-buttons @progress/kendo-react-dropdowns @progress/kendo-react-dialogs
  2. Once installed, import the package module.

    // ES2015 module syntax
    import { Editor, EditorTools } from '@progress/kendo-react-editor';
    // CommonJS format
    const { Editor, EditorTools } = require('@progress/kendo-react-editor');
  3. You are required to install one of the Kendo UI themes to style your components. For more information on how to add the styles, refer to the article on getting started.

Dependencies

Under the hood, the KendoReact Editor uses the ProseMirror toolkit. This allows you to utilize the full range of the ProseMirror functionalities and build on top of the existing Editor features.

The Editor package requires the following peer dependencies that have to be installed by your application:

  • react 16.8.2*
  • react-dom
  • @progress/kendo-react-intl
  • @progress/kendo-react-buttons
  • @progress/kendo-react-dropdowns
  • @progress/kendo-react-dialogs
 /