material-ui-rte

1.2.4 • Public • Published

Material-UI-RTE

Description

A rich text editor build with Draft.js and Material UI

Installation

yarn add material-ui-rte

Example

Filling this out later

API

Editor Props

Currently, all controls follow this property setup unless otherwise specified...

Specifying a boolean will completely show / hide the controls altogether.

Specifying an array will only show the buttons / menu items that were passed in.

Block styles (headings, paragraph, etc.)

  blockStyleControls: PropTypes.oneOfType([
    PropTypes.bool,
    PropTypes.arrayOf("paragraph", "blockquote", "header-one", "header-two", "header-three", "header-four", "header-five", "header-six")
  ])
 
  defaultProps = {
    blockStyleControls: true
  }

Divider

  dividerControl: PropTypes.bool
 
  defaultProps = {
    dividerControl: true
  }

The Divider Control does not accept an array value since it's only one button 😁

Inline Style Controls (bold, italic, underline)

  inlineStyleControls: PropTypes.oneOfType([
    PropTypes.bool,
    PropTypes.arrayOf("bold", "italic", "underline")
  ])
 
  defaultProps = {
    inlineStyleControls: true
  }

List Controls

  listControls: PropTypes.oneOfType([
    PropTypes.bool,
    PropTypes.arrayOf("ordered-list", "unordered-list")
  ])
 
  defaultProps = {
    listControls: true
  }

List Controls

  alignmentControls: PropTypes.oneOfType([
    PropTypes.bool,
    PropTypes.arrayOf("left", "center", "right")
  ])
 
  defaultProps = {
    alignmentControls: true
  }

Development

yarn start

Make changes to src/app.js for testing, webpack-dev-server is run at localhost:4400

Run tests with yarn test

ToDo

  • Move docs to Docz
  • Setup live pages for storybook and docz
  • Color picker
  • Image controls
  • Support for custom controls
  • support for additional draft.js plugins
  • support for plain text and html as initial values

PR's welcome!

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.2.42latest

Version History

VersionDownloads (Last 7 Days)Published
1.2.42
1.2.30
1.2.20
1.2.11
1.2.00
1.1.30
1.1.20
1.1.10
1.1.00
1.0.00
0.2.00
0.1.40
0.1.30
0.1.20
0.1.10
0.1.00
0.0.10

Package Sidebar

Install

npm i material-ui-rte

Weekly Downloads

3

Version

1.2.4

License

MIT

Unpacked Size

3.63 MB

Total Files

63

Last publish

Collaborators

  • jordan4jc