npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-cool-cursors

v2.0.0

Published

A very simple npm package for react,offering smooth,many customisable cursors.

Downloads

460

Readme

ReactCoolCursors

A simple npm package for React that offers smooth, customizable cursors.

Project Logo

Installation

You can install react-cool-cursors using npm:

npm install react-cool-cursors

Cursor Styles

As react-cool-cursors expands, you can easily switch between different cursor styles. The current options are:

| Cursor Style | Import Code | Demo Button | | ------------ | ---------------------------------------------------- | ----------------------------------------------------------------------------------------------- | | SimpleCursor | import { SimpleCursor } from "react-cool-cursors"; | View Demo | | FluidCursor | import { FluidCursor } from "react-cool-cursors"; | View Demo | | PieCursor | import { PieCursor } from "react-cool-cursors"; | View Demo |

Basic Usage

To use the cursors from the library, follow these steps:

  1. Import the Component: In your main file (e.g., App.js or index.js), add the following imports:
import { SimpleCursor } from "react-cool-cursors"; // or FluidCursor
import "react-cool-cursors/dist/style.css";
  1. Add the Cursor Component: Place the desired cursor component in your render method:
<SimpleCursor />
// or
<FluidCursor />

Customization

You can customize the cursor's appearance using the following attributes:

| Attribute | Description | Default Value | | ------------------ | --------------------------------------------------------------- | ------------- | | size | Set the size of the cursor | 30 | | color | Change the cursor color | black | | opacity | Adjust the cursor's opacity | 1 | | border | Set the cursor's border using CSS syntax | none | | TransitionTime | Set the cursor's transition time using number values in seconds | 0.2 | | InnerBorderColor | Set the color (its for only pie cursor) | black |

Example

Here’s an example of how to use the SimpleCursor with a custom styling:

import React from "react";
import { SimpleCursor } from "react-cool-cursors";
import "react-cool-cursors/dist/style.css";

const App = () => {
  return (
    <div>
      <SimpleCursor
        size={30}
        color="red"
        opacity={0.5}
        border="1px dotted blue"
        TransitionTime={0.5}
      />
      {/* Your other components */}
    </div>
  );
};

export default App;

Disable default cursor showing

You can disable the default cursor by adding the following css into index.css file:

body{
  cursor:none
}

Changing Cursor Types

To change the cursor type in the future, simply import the desired cursor component:

import { [NewCursorStyle] } from "react-cool-cursors";

Then use it in your component:

<NewCursorStyle
  size={30}
  color="red"
  opacity={1}
  border="1px solid green"
  TransitionTime={0.5}
/>

Example of Changing Type

For instance, if a new cursor Type called SparkleCursor is added:

import { SparkleCursor } from "react-cool-cursors";

const App = () => {
  return (
    <div>
      <SparkleCursor
        size={35}
        color="pink"
        opacity={1}
        border="3px dotted purple"
        TransitionTime={0.5}
      />
      {/* Your other components */}
    </div>
  );
};

Conclusion

react-cool-cursors provides an easy way to implement customizable cursors in your React applications. Enjoy smooth, interactive cursors that enhance user experience!

Contributions

If you want to contribute to this project, fork the repository and clone it to your local machine. Commit your changes and push your changes to your forked repository. Finally, open a pull request with a detailed description of your changes to the dev branch.I highly appreciate any contributions.

Issues

If you are facing any problem, feel free to share here.

Changelog

### [Unreleased]
- Features and improvements are being developed.

### [1.0.0] - 2024-10-19
- Initial release of `react-cool-cursors`.
- Added `SimpleCursor` and `FluidCursor` components.
- Included basic usage examples in the documentation.

### [1.0.1] - 2024-10-19
- Enhanced cursor animation on click for both cursor types.
- Fixed issues with cursor position during scaling on click.
- Improved performance for cursor movement tracking.

### [1.0.4] - 2024-10-19
- Issue fixed with scroll bar and fluid cursor z index issue too.
- Fixed issues with the fluid cursor props.
- Improved performance for cursor movement tracking.

### [1.1.1] - 2024-10-20
- Switched to typescript method so that it work on both js and ts.
- Added Border Styling Method.
- Improved codes for Typescript.
- Made sure the component works on both typescript and javascript.

### [1.1.2] - 2024-10-20
- Issue fixed with cursor positioning on fluid cursor.

### [1.1.3] - 2024-10-21
- Readme Instruction improved.
- Code optimization done.

### [1.1.4] - 2024-10-24
- Todo added.
- Fluid cursor design improved.

### [2.0.0] - 2024-10-25
- Transition time control attribute added.
- Pie Cursor style added.
- Pie Cursor style code optimization done.

Contact Me

Gmail WhatsApp LinkedinFaceBookTelegram

Todo

  • ~~Add method to control transition time~~
  • ~~Add Pie cursor style~~
  • Add magic color effect on cursor move.
  • Add click style effect on cursor click.
  • Add Circle Dot cursor style.
  • Add Emoji cursor style.
  • Add Fire cursor style.
  • Add Custom cursor style.
  • Add Bubble effect while cursor moving.
  • Add Small dot cursor style.
  • Add Neon cursor style.
  • Add Ripple effect cursor moving.
  • Add Snake effect cursor moving.
  • Add Packman cursor style.

License

This project is licensed under the Apache 2.0 License. See the LICENSE file for more details.

License