Skip to content

jserTang/react-rich-text-editor

Repository files navigation

react-rich-text-editor

description

Rich text editor based on react. With superior compatibility, you can perfectly retain the text format copied from anywhere !!

Usage

npm i jserTang@react-rich-text-editor

Demo

git clone https://github.com/jserTang/react-rich-text-editor.git
cd react-rich-text-editor
npm i && npm start

platform=pc PC

platform=mobile PC

Example

import { RichTextEditor } from 'jserTang@react-rich-text-editor';

const Demo = () => {
    const defaultContent = 'default content!';
    const config = {
        menuBarFixTop: 0,
        menus: defaultMenus,
        placeholder: 'This is placeholder',
    };

    const onUpdate = (data: { html: string; text: string }) => {
        console.log(data.html);
    };

    return <RichTextEditor config={config} content={defaultContent} onUpdate={onUpdate} />;
}

props

  • content: Initial text content
  • config: Editor configuration; menu, placeholder are configured here
  • extensions: Extension plug-ins are configured here
  • i18n: Configure the copy that should be displayed in the editor
  • onUpdate: This callback is performed when the content changes

About

Rich text editor based on react. You can perfectly retain the text format copied from anywhere !!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors