1.0.6 • Published 5 years ago

react-block-highlight v1.0.6

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

React Block Highlight

React Component to highlight any part of the containing block in rectangle.

Demo - https://react-block-highlight.netlify.com/

Installation

  npm i react-block-highlight --save

Usage

Importing component

import ReactBlockHighlight from "react-block-highlight";

Highlighting some part of block

Part of the block that requires to be highlighted can be passed in props with opacity and color

const highlightProps = { x, y, height, width, opacity, color };

<ReactBlockHighlight id="demo-space" {...highlightProps}>
  {
  <div>Hifglight some part of this div</div>
  }
</ReactBlockHighlight>

Props

PropTypeDescriptionDefault Value
idstringUnique id for the canvas element"block-highlight-canvas"
xnumberx-coordinate of starting point0
ynumbery-coordinate of starting point0
heightnumberHeight of the area to be highlighted20
widthnumberWidth of the area to be highlighted250
opacitynumber(0-1)Opacity of the area to be highlighted0.5
colornumberColor of the area to be highlighted in RGB"#ffff00"
1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.3-0

5 years ago

1.0.2-1

5 years ago

1.0.2-0

5 years ago

1.0.1-0

5 years ago

1.0.0

5 years ago