Paragraph is default plugin for Yoopta-Editor
yarn add @yoopta/paragraph
import Paragraph from '@yoopta/paragraph';
const plugins = [Paragraph];
const Editor = () => {
return <YooptaEditor plugins={plugins} />;
};
- .yoopta-paragraph
const Paragraph = new YooptaPlugin({
options: {
display: {
title: 'Text',
description: 'Start writing plain text.',
},
shortcuts: ['p', 'text'],
},
});
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
},
},
});
];