2.5.0 • Published 2 years ago

react-svg-cursor v2.5.0

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

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.

2.3.0

2 years ago

2.0.3

2 years ago

2.2.0

2 years ago

2.0.2

2 years ago

2.5.0

2 years ago

2.0.5

2 years ago

2.2.5

2 years ago

2.1.5

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago