Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
react-bound-highlight
Advanced tools
React component for connecting elements hover states
Two directions bound:
Two directions bound with current element highlight ON:
Single direction bound:
Multiple elements in bound:
Custom highlight styles:
Can be used for building side by side editor like this:
npm install react-bound-highlight --save
Wrap needed elements and specify unique id for connected components group:
import BoundHighlight from 'react-bound-highlight';
...
<div>
<BoundHighlight id="group1">Group 1</BoundHighlight>
<BoundHighlight id="group2">Group 2</BoundHighlight>
...
<BoundHighlight id="group1">Group 1</BoundHighlight>
<BoundHighlight id="group2">Group 2</BoundHighlight>
</div>
...
Prop | Description | Type | Default |
---|---|---|---|
id* | unique group bound identifier | string | |
currentHoverHighlightOn | turn on hover highlight on current element | bool | false |
oppositeHoverHighlightOff | turn off current component oposite highlight | bool | false |
defaultStyleOff | turn off default style for highligting | bool | false |
className | custom className | string | 'BoundHighlight' |
htmlTag | wrapper HTML tag | string | 'span' |
children* | nested elements | string, node |
Use classes to override highlighting styles. Set defaultStyleOff=true
prop to turn off default style.
Class | Desciption |
---|---|
BoundHighlight | Main class name, can by override via className prop |
{className}--currentHover | Current hover state className |
{className}--boundHover | Bound hover state className |
Review all examples on storybook:
npm run storybook
npm run test
Run linter:
npm run lint
Fix formatting issues:
npm run lint:fix
MIT
FAQs
Highlight other components when a component is hovered
We found that react-bound-highlight 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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.