0.3.12 • Published 3 years ago

@jeremyling/react-material-ui-rich-text-editor v0.3.12

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

React Material UI Rich Text Editor

A WYSIWYG rich text editor built with Slate using Material UI components. This project is heavily influenced by the examples provided in the Slate documentation and this article on Smashing Magazine.

Installation

npm install --save @jeremyling/react-material-ui-rich-text-editor

The following packages are peer dependencies and must be installed in your project for this package to work.

@emotion/react
@emotion/styled
@mui/icons-material
@mui/material
lodash
react-mui-color

Usage Example

import React, { useState } from "react";
import Editor from "@jeremyling/react-material-ui-rich-text-editor";

const initialHtml = "<p>Paragraph</p>";

export default function RichTextEditor(props) {
  const [html, setHtml] = useState(initialHtml);

  return <Editor html={html} updateHtml={(html) => setHtml(html)} />;
}

Props

PropTypeDefaultDescription
htmlstringundefinedHTML to be deserialized as value.
updateHtmlfunc(html) => {}Method to update html, taking serialized html as argument
containerPropsobjectundefinedProps to pass to the Material UI Paper wrapper
editablePropsobjectundefinedProps to pass to the Slate Editable component

If html is not set, value will default to

[
  {
    "type": "Paragraph",
    "children": [{ "text": "" }]
  }
]
0.3.12

3 years ago

0.3.9

3 years ago

0.3.11

3 years ago

0.3.10

3 years ago

0.3.8

4 years ago

0.3.0

4 years ago

0.2.1

4 years ago

0.3.6

4 years ago

0.3.5

4 years ago

0.3.7

4 years ago

0.3.2

4 years ago

0.2.3

4 years ago

0.3.1

4 years ago

0.2.2

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.2.4

4 years ago

0.1.22

4 years ago

0.1.23

4 years ago

0.1.24

4 years ago

0.1.25

4 years ago

0.2.0

4 years ago

0.1.21

4 years ago

0.1.20

4 years ago

0.1.19

4 years ago

0.1.15

4 years ago

0.1.16

4 years ago

0.1.17

4 years ago

0.1.18

4 years ago

0.1.14

4 years ago

0.1.10

4 years ago

0.1.11

4 years ago

0.1.12

4 years ago

0.1.13

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.9

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago