Skip to content

MovingCursor is a simple React Package which implements a Cursor that follows Mouse Position

Notifications You must be signed in to change notification settings

semikolan-co/MovingCursor

Repository files navigation

movingcursor

MovingCursor is a simple React Package which implements a Cursor that follows Mouse Position

NPM JavaScript Style Guide

Install

npm install --save movingcursor

Import in your React App

You can Import the package in your React App by using the following code:

import MovingCursor from 'movingcursor';

Make components Active

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.

Add Custom Configuration

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'
}} />

Usage

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>
    </>
  )
}

Join Us

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

Code Contributers

This project exists thanks to all the people who contribute.

License

MIT © meinhoonharsh

About

MovingCursor is a simple React Package which implements a Cursor that follows Mouse Position

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published