hubgit / sub-ed

A React component that provides Substance as an HTML editor

Home Page:https://www.npmjs.com/package/sub-ed

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sub-ed

A React component providing Substance as an HTML editor

Usage

// import the ArticleEditor component
import ArticleEditor from 'sub-ed'

// import the Substance and Font Awesome styles
import 'sub-ed/dist/styles.css'

const containerStyle = {
  position: 'fixed',
  top: 0,
  left: 0,
  right: 0,
  bottom: 0,
  overflow: 'hidden'
}

class Foo extends React.Component {
  updateArticle = ({ html }) => {
    // update the saved article
  }
  
  render () {
    const { article } = this.state

    return (
      <div style={containerStyle}>
        <ArticleEditor html={article.html} save={this.updateArticle}/>
      </div>
  }
}

About

A React component that provides Substance as an HTML editor

https://www.npmjs.com/package/sub-ed


Languages

Language:JavaScript 100.0%