@djyde/react-quill

0.1.2 • Public • Published

ReactQuill

Quilljs in React. Based on Quill 1.0

NPM downloads

Install

$ npm install @djyde/react-quill --save-dev

Quick Start

import React from 'react'
import ReactQuill from 'react-quill'

// import stylesheet
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'

class Editor extends React.Component {

  render () {
    const options = {
      theme: 'snow'
    }

    function onChange (html) {
      console.log(html)
    }

    const events = {
      'text-change': delta => {
        console.log(delta)
      }
    }

    return (
      <div>
        <ReactQuill options={options} events={events} onChange={onChange} ref='editor'/>
      </div>
    )
  }
}

// render <Editor />

API

props

  • onChange(html)

  • options

An options object

  • events

An object contains events

methods

  • getHTML()

Get the HTML

members

  • $quill

The quill instance

  • $el

The quill element

License

MIT License

/@djyde/react-quill/

    Package Sidebar

    Install

    npm i @djyde/react-quill

    Weekly Downloads

    2

    Version

    0.1.2

    License

    MIT

    Last publish

    Collaborators

    • djyde