A React toolkit for building cross-platform text editors, based on ProseMirror
Motivation · Status · Documentation · Storybook · Contributing
Introduction
import React from 'react';
import { BoldExtension, ItalicExtension, UnderlineExtension } from 'remirror/extensions';
import { Remirror, useRemirror, OnChangeJSON } from '@remirror/react';
const extensions = () => [new BoldExtension(), new ItalicExtension(), new UnderlineExtension()];
const Editor = ({ onChange }) => {
const { manager, state } = useRemirror({
extensions,
content: '<p>Hi <strong>Friend</strong></p>',
stringHandler: 'html',
selection: 'end',
});
return (
<Remirror manager={manager} initialContent={state}>
<OnChangeJSON onChange={onChange} />
</Remirror>
);
};
With this code snippet your editor now supports…