🚀. Socket Launch Week Day 3:Socket Firewall Now Blocks Malicious VS Code and Open VSX Extensions.Learn more
Sign In

react-svg-cursor

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-svg-cursor

Use any SVG or Image as your custom cursor

latest
Source
npmnpm
Version
2.5.0
Version published
Weekly downloads
32
33.33%
Maintainers
1
Weekly downloads
 
Created
Source

react-svg-cursor

Use any image or SVG as a cursor in your react project.

Installation

npm install --save react-svg-cursor

Usage

import { CustomCursor } from "react-svg-cursor";

import svg from "./assets/test.svg";
// or
import png from "./assets/test.png";

ReactDOM.render(
  <>
    <App />
    <CustomCursor
      component={svg}
      isDisabled={false}
      width={20}
      height={20}
      zIndex={420}
      transform="translate(-30%, -10%) rotateZ(-22deg)"
    />
  </>,
  document.getElementById("root")
);

Props

nametypedefaultdescription
componentanynoneYour asset to be used as cursor
isDisabledbooleanfalseTurn on or off your custom cursor
widthnumber18Width
heightstring18Height
zIndexnumber999z-index, adjust for your app
transformstring"none"You can use this to rotate your cursor, works exactly like css rule

Custom styles

You can add your styles on .rsc-cursor class name

Licence

MIT-licensed. See LICENSE.

Keywords

React

FAQs

Package last updated on 09 Feb 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts