slash-rich-text-editor
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i slash-rich-text-editor

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

87.7 kB

Total Files

13

Last publish

Collaborators

  • maiducthang279