reactjs-content-editable
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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

prop description type
html required: innerHTML of the editable element String
disabled use true to disable editing Boolean
onChange called whenever innerHTML changes Function
className there is no default className are given, you can add your own String
style style properties which support react style format, by default height is set to 200px Object
innerRef if you want to control the element, you can pass ref LegacyRef

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

Package Sidebar

Install

npm i reactjs-content-editable

Weekly Downloads

6

Version

1.0.2

License

MIT

Unpacked Size

16.7 kB

Total Files

25

Last publish

Collaborators

  • libinprasanth