1.0.0 • Published 1 year ago

slash-rich-text-editor v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

slash-rich-text-editor

A rich text editor base on HTML contenteditable

NPM JavaScript Style Guide

Install

npm install --save slash-rich-text-editor

Usage

import React, { useState } from 'react'

import EditablePage, { BlockModel } from 'slash-rich-text-editor'
import 'slash-rich-text-editor/dist/index.css'

const Example = () => {
  const [value, setValue] = useState<BlockModel[]>([
    { id: 'default', html: 'Default paragraph', tag: 'p' }
  ])
  return (
    <EditablePage
      value={value}
      onChange={(result: BlockModel[]) => setValue(result)}
    />
  )
}

License

MIT © maiducthang279