sub-ed

0.1.6 • Public • Published

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>
  }
}

Readme

Keywords

Package Sidebar

Install

npm i sub-ed

Weekly Downloads

2

Version

0.1.6

License

ISC

Last publish

Collaborators

  • aeaton