# react-smooth-cursor

> React smooth cursor library

Latest version **1.1.0** (published 2020-09-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-smooth-cursor
pnpm add react-smooth-cursor
yarn add react-smooth-cursor
bun add react-smooth-cursor
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2020-09-20 |
| First published | 2020-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 68.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Mustafa Demirtaş |
| Maintainers | musdem |
| Keywords | cursor, react, typescript, component |

## Links

- npm: https://www.npmjs.com/package/react-smooth-cursor
- Repository: https://github.com/mustafademirtas/react-smooth-cursor
- Homepage: https://github.com/mustafademirtas/react-smooth-cursor#readme
- Issues: https://github.com/mustafademirtas/react-smooth-cursor/issues
- npm.io page: https://npm.io/package/react-smooth-cursor

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2020-09-20
- 1.0.3 — 2020-09-19
- 1.0.2 — 2020-09-18
- 1.0.1 — 2020-09-14
- 1.0.0 — 2020-09-14

## README

# react-smooth-cursor

> Smooth cursor library

<div align="center">
    <img src="screenshots/ScreenRecord01.gif" width="100%" />
</div>

[![NPM](https://img.shields.io/npm/v/react-smooth-cursor.svg)](https://www.npmjs.com/package/react-smooth-cursor) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![Build Status](https://travis-ci.org/mustafademirtas/react-smooth-cursor.svg?branch=master)](https://travis-ci.org/mustafademirtas/react-smooth-cursor)

## Install

```bash
yarn add react-smooth-cursor
```

or

```bash
npm install react-smooth-cursor
```

## Usage

```tsx
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

| Option        | Type      | Description                                                    | Default     |
| ------------- | --------- | -------------------------------------------------------------- | ----------- |
| `selectors`   | string[ ] | Anys valid css selectors list which cursor will be animated on | `undefined` |
| `shape`       | string    | Shape of cursor ("circle" or "square")                         | `circle`    |
| `fillColor`   | string    | Inside color of cursor                                         | `#fff`      |
| `strokeColor` | string    | Border color of cursor                                         | `#000`      |
| `strokeWidth` | number    | Border width of cursor                                         | `1`         |
| `smoothness`  | number    | Smooth movement value of cursor (0 - 1.0)                      | `0.2`       |
| `endScale`    | number    | Cursor scale animation to value (1 to infinity)                | `4`         |
| `endOpacity`  | number    | Cursor opacity animation to value (0 - 1.0)                    | `0.2`       |

## Circle Cursor Props

| Option         | Type   | Description   | Default |
| -------------- | ------ | ------------- | ------- |
| `circleRadius` | number | Cursor radius | `25`    |

## Square Cursor Props

| Option      | Type   | Description | Default |
| ----------- | ------ | ----------- | ------- |
| `shapeSize` | number | Square size | `25`    |

## Alien Cursor Props

| Option      | Type   | Description | Default |
| ----------- | ------ | ----------- | ------- |
| `shapeSize` | number | Alien size  | `25`    |

## License

MIT © [mustafademirtas](https://github.com/mustafademirtas)

---
_Source: https://npm.io/package/react-smooth-cursor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
