@remirror/extension-bold
Make your text bold. Make it courageous.
Installation
yarn add @remirror/extension-bold
pnpm add @remirror/extension-bold
npm install @remirror/extension-bold
This is included by default when you install the recommended remirror
package. All exports are also available via the entry-point, remirror/extensions
.
Usage
When added to your editor it will provide the toggleBold
command which makes the text under the cursor / or at the provided position range bold.
import { ExtensionPriority, RemirrorManager } from 'remirror';
import { BoldExtension, CorePreset } from 'remirror/extensions';
const boldExtension = new BoldExtension({ weight: '500' });
const corePreset = new CorePreset();
const manager = RemirrorManager.create([boldExtension, corePreset]);
const element = document.createElement('div');
document.body.append(element);
manager.addView(element);
manager.commands.toggleBold();
manager.commands.toggleBold({ from: 1, to: 7 });