MovingCursor is a simple React Package which implements a Cursor that follows Mouse Position
npm install --save movingcursor
You can Import the package in your React App by using the following code:
import MovingCursor from 'movingcursor';
You can make the components active by adding a data attribute data-active
as 1
to the component. Like this:
<span data-active="1">Hover Me</span>
This will make the cursor glow when the component is hovered.
You can add custom configuration to the package by passing a parameter named config
to the component. Like this:
<MovingCursor config={{
color: '#64ffda',
size: '35px',
borderSize: '2px',
delay: '0.2s'
}} />
import React from 'react'
import MovingCursor from 'movingcursor'
const MyComponent = () => {
const cursorConfig = {
color: '#64ffda',
size: '35px',
borderSize: '2px',
delay: '0.2s'
}
return (
<>
<MovingCursor config={cursorConfig} />
<div>
<h1>Hello World</h1>
<span data-active={1}>Hover Me</span>
</div>
</>
)
}
Be a part of the SemiKolan Developer's Community by joining our Discord Server. Here you can discuss about the project or ask any other queries and there will be a lot of folks to help
This project exists thanks to all the people who contribute.
MIT © meinhoonharsh