1.1.0 • Published 4 years ago

react-smooth-cursor v1.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

react-smooth-cursor

Smooth cursor library

NPM JavaScript Style Guide Build Status

Install

yarn add react-smooth-cursor

or

npm install react-smooth-cursor

Usage

import React, { Component } from 'react'

import SmoothCursor from 'react-smooth-cursor'
import 'react-smooth-cursor/dist/index.css'

class Example extends Component {
  render() {
    (
    return
    <SmoothCursor
      // Required
      selectors={['antValidCssSelector01','antValidCssSelector02']}
      // Optionals
      fillColor='#e20c6a'
      strokeColor='#000'
      strokeWidth={1}
      cursorRadius={25}
    />
    )
  }
}

// or

const Example = () => {
  return(
  <SmoothCursor
    // Required
    selectors={['antValidCssSelector01','antValidCssSelector02']}
    // Optionals
    fillColor='#e20c6a'
    strokeColor='#000'
    strokeWidth={1}
    cursorRadius={25}
  />
  )
}

General Props

OptionTypeDescriptionDefault
selectorsstring Anys valid css selectors list which cursor will be animated onundefined
shapestringShape of cursor ("circle" or "square")circle
fillColorstringInside color of cursor#fff
strokeColorstringBorder color of cursor#000
strokeWidthnumberBorder width of cursor1
smoothnessnumberSmooth movement value of cursor (0 - 1.0)0.2
endScalenumberCursor scale animation to value (1 to infinity)4
endOpacitynumberCursor opacity animation to value (0 - 1.0)0.2

Circle Cursor Props

OptionTypeDescriptionDefault
circleRadiusnumberCursor radius25

Square Cursor Props

OptionTypeDescriptionDefault
shapeSizenumberSquare size25

Alien Cursor Props

OptionTypeDescriptionDefault
shapeSizenumberAlien size25

License

MIT © mustafademirtas

1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago