
Description
react-contenteditable is a React component that renders a div with editable contents, so users can type into it like a text box that accepts rich text. It is useful when a plain textarea is not enough, for example when you need formatting or inline elements inside the editable area. The component takes an html prop for the content, which is the innerHTML of the editable element, The README lists the available props, including innerRef for the element's reference and disabled for turning editing off. It also has a section on known issues, which the developer should read because contenteditable behaviour differs between browsers. The README includes install and usage examples. The library suits React developers who want a simple editable element with controlled HTML, rather than a full rich text editor.…
Highlights
- Editable div for React
- Controlled html prop and change callback
- innerRef and disabled props
- Known issues documented
Ratings & Reviews
No ratings yet
Be the first to rate react-contenteditable.
People also visit

react-autosize-textarea
replacement for built-in textarea which auto resizes itself
react-contenteditable FAQ
What is react-contenteditable?
A React component for a div with editable contents.
How is the content set?
With the html prop, which is the innerHTML of the editable element.
Are there known issues?
Yes. The README has a known issues section, which is worth reading because browser behaviour varies.
How do I install it?
Follow the install section of the README.
What are the best react-contenteditable alternatives?
Popular alternatives to react-contenteditable include react-summernote, @tinymce/tinymce-react and react-quilljs. See all react-contenteditable alternatives
















