Skip to content

Latest commit

 

History

History
62 lines (49 loc) · 1003 Bytes

File metadata and controls

62 lines (49 loc) · 1003 Bytes

Paragraph plugin

Paragraph is default plugin for Yoopta-Editor

Installation

yarn add @yoopta/paragraph

Usage

import Paragraph from '@yoopta/paragraph';

const plugins = [Paragraph];

const Editor = () => {
  return <YooptaEditor plugins={plugins} />;
};

Default classnames

  • .yoopta-paragraph

Default options

const Paragraph = new YooptaPlugin({
  options: {
    display: {
      title: 'Text',
      description: 'Start writing plain text.',
    },
    shortcuts: ['p', 'text'],
  },
});

How to extend

const plugins = [
  Paragraph.extend({
    renders: {
      paragraph: (props) => <YourCustomComponent {...props} />
    },
    options: {
      shortcuts: [`<your custom shortcuts>`],
      display: {
        title: `<your custom title>`,
        description: `<your custom description>`,
      },
      HTMLAttributes: {
        className: '<your classname>',
        // ...other HTML attributes
      },
    },
  });
];