# react-tap-event

> react tap组件，支持onTap事件以及点击态

Latest version **2.0.1** (published 2017-06-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-tap-event
pnpm add react-tap-event
yarn add react-tap-event
bun add react-tap-event
```

## 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 | 2.0.1 |
| Published | 2017-06-09 |
| First published | 2016-12-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | walkeshixy |
| Maintainers | walkershixy |
| Keywords | react, tap, react-tap, react-component |

## Links

- npm: https://www.npmjs.com/package/react-tap-event
- Repository: https://github.com/shixy/react-tap
- Homepage: http://shixy.github.io/react-tap/
- Issues: https://github.com/shixy/react-tap/issues
- npm.io page: https://npm.io/package/react-tap-event

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

- 2.0.1 (latest) — 2017-06-09
- 1.0.3 — 2016-12-23
- 1.0.2 — 2016-12-23
- 1.0.1 — 2016-12-23
- 1.0.0 — 2016-12-22

## README

# react-tap-event
react tap组件，支持onTap事件以及点击态,同时增加了ios惯性滚动点停的功能。

![](./tap.gif)


# install

```shell
    npm install react-tap-event
```

# usage

```js
import React, { PropTypes } from 'react'
require('./TapDemo.less');
require('react-tap-event');

class TapDemo extends React.Component {
onTap(index) {
    alert(index);
}
render () {
    return (
        <div>
            <div className="demo-title">Tap</div>
            <div className="tap-container">
                <div className="tap button" onTap={()=>this.onTap(1)} tapActive={true}>tap1</div>
                <div className="tap button" onTap={()=>this.onTap(2)} tapActive={'tap-ripple'}>tap2</div>
                <div className="tap button" onTap={()=>this.onTap(3)} tapActive={'green'}>tap3</div>
            </div>
        </div>
    )
}
}

export default TapDemo;

```

# docs
**onTap**

> 与onClick事件一样的使用方式，只在基础的html标签上生效

**tapActive**

>  true: 开启默认点击态   background-color:rgba(0,0,0,.1)

> String: 自定义className，个性化点击态

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