@yoopta/paragraph
v4.9.2
Published
Paragraph plugin for Yoopta Editor
Downloads
7,442
Readme
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
},
},
});
];