0.11.2 • Published 3 years ago

@grammarly/react-slate v0.11.2

Weekly downloads
58
License
-
Repository
github
Last release
3 years ago

Grammarly plugin for React + Slate

Bringing the Grammarly experience to apps that use Slate. No browser extension required.

Getting started

Install the Grammarly plugin for Slate:

npm install @grammarly/react-slate

Set up an instance of the Slate editor with Grammarly:

// 1. Import Grammarly components
import { GrammarlyEditable, GrammarlySlate } from "@grammarly/react-slate";

import React, { useMemo, useState } from "react";
import { createEditor } from "slate";
import { withReact, Slate } from "slate-react";

export function SlateEditor() {
  const [value, setValue] = useState([]);
  const editor = useMemo(() => withReact(createEditor()), []);

  // 2. Render using <GrammarlySlate> and <GrammarlyEditable>
  return (
    <Slate value={value} editor={editor} onChange={(value) => setValue(value)}>
      <GrammarlySlate value={value} clientId="your-client-id-here">
        <GrammarlyEditable />
      </GrammarlySlate>
    </Slate>
  );
}
0.11.2

3 years ago

0.11.0

3 years ago

0.10.18

3 years ago

0.10.17

3 years ago

0.10.16

3 years ago

0.10.14

3 years ago

0.10.11

3 years ago

0.10.12

3 years ago

0.10.9

3 years ago

0.10.8

3 years ago

0.10.5

3 years ago

0.10.4

3 years ago

0.10.3

3 years ago

0.10.2

3 years ago

0.10.1

3 years ago

0.10.0

3 years ago