Editor Overview

The Editor enables users to create rich textual content through a What-You-See-Is-What-You-Get (WYSIWYG) interface.

It delivers a set of tools for creating, editing, and formatting of text, paragraphs, lists, and other HTML elements.

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')
);
const content = `
    <p>
        The KendoReact Editor allows your users to edit HTML in a familiar,
        user-friendly way.<br />The Editor provides the core HTML
        editing engine, which includes text formatting, hyperlinks, and lists.
        The component <strong>outputs identical HTML</strong> across all major browsers,
        follows accessibility standards, and provides API for content manipulation.
    </p>
    <p>Features include:</p>
    <ul>
        <li>Text formatting</li>
        <li>Bulleted and numbered lists</li>
        <li>Hyperlinks</li>
        <li>Cross-browser support</li>
        <li>Identical HTML output across browsers</li>
    </ul>
`;

export default content;

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 } from '@progress/kendo-react-editor';
    // CommonJS format
    const { Editor } = 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

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

Functionality and Features

In this article