@binarycapsule/editor

Prosemirror powered rich text editor.

Usage no npm install needed!

<script type="module">
  import binarycapsuleEditor from 'https://cdn.skypack.dev/@binarycapsule/editor';
</script>

README

BC logo

BC Editor

BC Editor is a Prosemirror based text editor with markdown shortcuts and serialization. It is highly inspired by:

Visit the demo at editor.binarycapsule.tech.

Getting started

The Editor is available as an npm package:

npm i @binarycapsule/editor

Peer dependencies:

npm i react react-dom @binarycapsule/ui-capsules

Usage

As a minimal implementation, pass a ref to the Editor. The editor's value can be accessed through it:

export const App = () => {
  const editorRef = React.useRef<{ view: EditorView; value: string }>();

  return (
    <div>
      <button
        onClick={() => {
          // Read the value from the ref
          console.log(editorRef.current?.value);
        }}
      >
        Save
      </button>

      <Editor ref={editorRef} />
    </div>
  );
};

Licensing

Licensed under the MIT License.