@yoopta/paragraph
TypeScript icon, indicating that this package has built-in type declarations

4.4.1 • Public • Published

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'],
  },
});

Options to extend

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

Readme

Keywords

none

Package Sidebar

Install

npm i @yoopta/paragraph

Weekly Downloads

646

Version

4.4.1

License

MIT

Unpacked Size

10.3 kB

Total Files

13

Last publish

Collaborators

  • dargo05