Socket
Book a DemoInstallSign in
Socket

mx-react-wysiwyg

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mx-react-wysiwyg

React visual rich text editor with many options..

0.1.4
latest
Source
npmnpm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

react-wysiwyg

npm version Download Count

Simple React component for a rich editor text and the conversion to render HTML

Install

npm install mx-react-wysiwyg --save

Example

import { Wysiwyg, ConvertToHTML } from "mx-react-wysiwyg";
import 'semantic-ui-css/semantic.min.css';

class App extends Component {

  constructor(){
    super()
    this.state = {
      content: null
    }
  }

  updateValue(content){
    this.setState({content})
  }

  render {

    const { content } = this.state

    return (
      <div>
      <Wysiwyg
        onChange={this.updateValue.bind(this)}
        value={this.state.value}
      />

      <ConvertToHTML
        html={this.state.value}
      />
      </div>
    );
  }
}

Props

Wysiwyg props

FormatRequiredWhat it does ?
onChange{function}YESTakes a function that return
the content of the editor
valueObjectNOYou can make Wysiwyg a controlled
component by giving it a draft-js map value
boldBoolNOdefault to true
pass it to false to disable bold style
underlineBoolNOdefault to true
pass it to false to disable underline style
italicBoolNOdefault to true
pass it to false to disable italic style
h1, h2, h3, h4, h5, h6BoolNOdefault to true
pass it to false to disable h1, etc... style
blockQuoteBoolNOdefault to true
pass it to false to disable blockquote style
listBoolNOdefault to true
pass it to false to disable list style
numberedListBoolNOdefault to true
pass it to false to disable list numbered style
codeBoolNOdefault to true
pass it to false to disable code style

ConvertToHTML props

FormatRequiredWhat it does ?
htmlObjectYESObject from the Wysiwyg editor

Contributors

  • Francois Aubeut (@MeXaaR)

MIT Licensed

Keywords

react

FAQs

Package last updated on 25 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.