react-annotate-text

1.0.12 • Public • Published

react-annotate-text

code style: prettier

A custom react component for annotating text content inside HTML

Demo

Installation

npm install react-annotate-text

Feel free to replace with yarn counterparts.

Usage

import ReactAnnoteText from "react-annotate-text";
<ReactAnnotateText
  srcDoc={htmlContent}
  src={htmlURL}
  iframeTitle={"Demo"}
  height={600}
  width={500}
  highlightData={highlightData}
  selectionPopup={position => (
    <button onClick={() => addHighlightClick(position)}>Add Highlight</button>
  )}
  hoverPopup={id => (
    <button onClick={() => removeHighlightClick(id)}>Remove Highlight</button>
  )}
/>

See example directory for complete code.

Contributing

  1. Install dependencies
npm install
  1. Start development server
npm start

Dependents (0)

Package Sidebar

Install

npm i react-annotate-text

Weekly Downloads

17

Version

1.0.12

License

MIT

Unpacked Size

13.8 kB

Total Files

8

Last publish

Collaborators

  • howareyouami