1.0.2 • Published 7 months ago

reactjs-content-editable v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

react-content-editable

It's React component which support content editable div

Install

npm install reactjs-content-editable

Usage

import React, { useState } from 'react';
import { ContentEditable } from "reactjs-content-editable";

function App() {
  const [html, setHtml] = useState("")
  return (
    <>
      <ContentEditable 
        html={html} 
        onChange={(value: string) => setHtml(value)} 
      />
    </>
  );
}

export default App;

Available props

propdescriptiontype
htmlrequired: innerHTML of the editable elementString
disableduse true to disable editingBoolean
onChangecalled whenever innerHTML changesFunction
classNamethere is no default className are given, you can add your ownString
stylestyle properties which support react style format, by default height is set to 200pxObject
innerRefif you want to control the element, you can pass refLegacyRefReact.RefObject

Support

If you are facing any issue, please contact via linkedin ( Libin Prasanth ).

Examples

Do you want to try react-content-editable before use ?

Donate!

Like my Work! Donate