0.1.0 • Published 3 years ago

react-cursor-spotlight v0.1.0

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

react-cursor-spotlight

demo_gif

It is a react component that implements the cursor spotlight effect on mousemove.

Demo

Install

$ yarn add react-cursor-spotlight
// or
$ npm install --save react-cursor-spotlight

Usage

basic

import { CursorSpotlight } from 'react-cursor-spotlight';

<CursorSpotlight>
  <div>Contents</div>
</CursorSpotlight>

custom spotlight

import { CursorSpotlight } from 'react-cursor-spotlight';

const spotlightStyle = {
  width: '50px',
  height: '50px',
  radius: '0%',
  backgroundColor: '#fff',
};

<CursorSpotlight spotlightStyle={spotlightStyle}>
  <div>Contents</div>
</CursorSpotlight>