@remirror/extension-image
Add images to your editor.
Installation
yarn add @remirror/extension-image
pnpm add @remirror/extension-image
npm install @remirror/extension-image
This is included by default when you install the recommended remirror
package. All exports are also available via the entry-point, remirror/extensions
.
Usage
The following code sample will create a limited editor and run the available commands from this extension.
import { ExtensionPriority, RemirrorManager } from 'remirror';
import { CorePreset, ImageExtension } from 'remirror/extensions';
const imageExtension = new ImageExtension();
const corePreset = new CorePreset();
const manager = RemirrorManager.create([imageExtension, corePreset]);
const element = document.createElement('div');
document.body.append(element);
manager.addView(element);
manager.store.commands.insertImage({ src: `https://images.com/awesome.jpg` });