# @doiali/use-hover

> a hook to hover feature

Latest version **1.0.2** (published 2020-11-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install @doiali/use-hover
pnpm add @doiali/use-hover
yarn add @doiali/use-hover
bun add @doiali/use-hover
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-11-30 |
| First published | 2020-11-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | doiali |
| Maintainers | doiali |
| Keywords | react-hook, use-hover |

## Links

- npm: https://www.npmjs.com/package/@doiali/use-hover
- Repository: https://github.com/doiali/use-hover-react
- Homepage: https://github.com/doiali/use-hover-react#readme
- Issues: https://github.com/doiali/use-hover-react/issues
- npm.io page: https://npm.io/package/@doiali/use-hover

## 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.0.2 (latest) — 2020-11-30
- 1.0.1 — 2020-11-30
- 1.0.0 — 2020-11-30

## README

# react-use-hover
a hook that returns a hover state and a ref, pass the ref to a component, then the hover state becomes true when the mouse is hovering that component

## Installation
```js
npm install @doiali/use-hover
```
## Usage
```js
import React from 'react';
import useHover from '@doiali/use-hover';

export default function SayHello() {
    const [isHovering,ref] = useHover();
    const style = {
        height:80,
        width:150,
        textAlign: "center",
        margin:'auto',
        border:`1px solid black`,
    }

    return (
        <div ref={ref} style={style}>
            hover me! <br/>
            {isHovering && "Hello!"}
        </div>
    )
}
```

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