A rich text editor build with Draft.js and Material UI
yarn add material-ui-rte
Filling this out later
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.
blockStyleControls: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.arrayOf("paragraph", "blockquote", "header-one", "header-two", "header-three", "header-four", "header-five", "header-six")
])
defaultProps = {
blockStyleControls: true
}
dividerControl: PropTypes.bool
defaultProps = {
dividerControl: true
}
The Divider Control does not accept an array value since it's only one button 😁
inlineStyleControls: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.arrayOf("bold", "italic", "underline")
])
defaultProps = {
inlineStyleControls: true
}
listControls: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.arrayOf("ordered-list", "unordered-list")
])
defaultProps = {
listControls: true
}
alignmentControls: PropTypes.oneOfType([
PropTypes.bool,
PropTypes.arrayOf("left", "center", "right")
])
defaultProps = {
alignmentControls: true
}
yarn start
Make changes to src/app.js
for testing, webpack-dev-server
is run at localhost:4400
Run tests with yarn test
- 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!