Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
highlightable
Advanced tools
ReactJS component that help you highlight ranges of text and give you callbacks to detect user text selection.
npm install highlightable
<Highlightable ranges={ranges}
enabled={true}
onTextHighlighted={onTextHighlightedCallback}
id={uniqueId}
onMouseOverHighlightedWord={onMouseOverHighlightedWordCallback}
highlightStyle={{
backgroundColor: '#ffcc80'
}}
text={'text'}
/>
ranges -> array: of Range objects (see Range object below).
text -> string: the all text that the user can highlight.
enabled -> bool: The user can't highlight text if false.
onMouseOverHighlightedWord -> func: Callback function when the user mouse is over an highlighted text.
(range) => {}
onTextHighlighted -> func: Callback function when the user highlight new text.
(range) => {}
highlightStyle -> obj: Style of the text when the text is highlighted. or func:
(range, charIndex) => {return style}
style -> obj: The style of the main div container
rangeRenderer -> func: Use this function to customise the render of the highlighted text.
(currentRenderedNodes, currentRenderedRange, currentRenderedIndex, onMouseOverHighlightedWord) => {return node}
The range object attributes:
npm run build
- produces production versionnpm run dev
- produces development versionnpm test
- run the testsFAQs
Component that help highlighting text
The npm package highlightable receives a total of 1,199 weekly downloads. As such, highlightable popularity was classified as popular.
We found that highlightable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.