# use-demo-pointer

> This package provides a React hook that allows you to create a custom cursor for a specific component in your React application. The custom cursor can be an image or any other HTML element that you want to use.

Latest version **0.0.2-beta.1** (published 2023-07-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install use-demo-pointer
pnpm add use-demo-pointer
yarn add use-demo-pointer
bun add use-demo-pointer
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2-beta.1 |
| Published | 2023-07-22 |
| First published | 2023-07-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 14.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | larebsyed |
| Maintainers | larebsyed |
| Keywords | React, custom hook, timer, stopwatch, time logic, state management, requestAnimationFrame, elapsed time, auto-ticks, time format string, human-readable time strings, start function, stop function, running status, display time in human-readable formats, maximum time in seconds |

## Links

- npm: https://www.npmjs.com/package/use-demo-pointer
- Repository: https://github.com/larebsyed/use-dome-pointer
- npm.io page: https://npm.io/package/use-demo-pointer

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^18.2.0
- [@types/react](https://npm.io/package/@types/react.md) ^18.2.6

## 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

- 0.0.2-beta.1 (latest) — 2023-07-22
- 0.0.2-beta.0 — 2023-07-22
- 0.0.1-beta.9 — 2023-07-22
- 0.0.1-beta.8 — 2023-07-22
- 0.0.1-beta.7 — 2023-07-22
- 0.0.1-beta.6 — 2023-07-22
- 0.0.1-beta.5 — 2023-07-22
- 0.0.1-beta.4 — 2023-07-22
- 0.0.1-beta.3 — 2023-07-22
- 0.0.1-beta.2 — 2023-07-22
- 0.0.1-beta.1 — 2023-07-22

## README

# use-demo-pointer

This package provides a React hook that allows you to create a custom cursor for a specific component in your React application. The custom cursor can be an image or any other HTML element that you want to use.

## Installation

To install the package, run the following command:

```
npm install use-demo-pointer
```

## Usage

To use the custom cursor hook, import it into your React component and call it like this:

```jsx
import React from 'react';
import useDemoPointer from 'use-demo-pointer';

function MyComponent() {
  const { ref } = useDemoPointer();

  return (
    <div ref={ref}>
      {/* Your component content */}
    </div>
  );
}

export default MyComponent;
```

The `useDemoPointer` hook returns an object with a `ref` property that you can attach to the component that you want to apply the custom cursor to.

By default, the custom cursor will be a small circle with a background color of white and a border color of black. You can customize the appearance of the cursor by passing an options object to the `useDemoPointer` hook like this:

```jsx
const { ref } = useDemoPointer({
  cursor: 'url(cursor.png), auto',
  size: 20,
  borderRadius: '50%',
  backgroundColor: 'red',
  borderColor: 'blue',
});
```

The `cursor` option allows you to specify the CSS `cursor` property for the custom cursor. You can use any valid CSS value for this property, including URLs to images.

The `size` option allows you to specify the size of the custom cursor in pixels.

The `borderRadius` option allows you to specify the border radius of the custom cursor in CSS units.

The `backgroundColor` option allows you to specify the background color of the custom cursor.

The `borderColor` option allows you to specify the border color of the custom cursor.

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