draft-js-checkable-list-plugin

4.0.2 • Public • Published

draft-js-checkable-list-plugin

CircleCI Coverage Status

npm version License

Checkable list item plugin for the draft-js-plugins-editor .

yarn add draft-js-checkable-list-plugin

Live demo

Usage

Example

import React, { Component } from 'react'
import { EditorState } from 'draft-js'
import Editor from 'draft-js-plugins-editor'
import createCheckableListPlugin from 'draft-js-checkable-list-plugin'
import 'draft-js-checkable-list-plugin/lib/plugin.css'
 
const checkableListPlugin = createCheckableListPlugin()
const plugins = [checkableListPlugin]
 
class App extends Component {
  state = { editorState: EditorState.createEmpty() }
 
  onChange = editorState => this.setState({ editorState })
 
  render() {
    return (
      <div>
        <Editor
          editorState={this.state.editorState}
          plugins={plugins}
          onChange={this.onChange}
        />
      </div>
    )
  }
}

License

MIT

© sugarshin

Dependencies (4)

Dev Dependencies (38)

Package Sidebar

Install

npm i draft-js-checkable-list-plugin

Weekly Downloads

50

Version

4.0.2

License

MIT

Unpacked Size

29.2 kB

Total Files

21

Last publish

Collaborators

  • sugarshin