# bee-anchor

> Anchor ui component for react

Latest version **0.0.6** (published 2020-04-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install bee-anchor
pnpm add bee-anchor
yarn add bee-anchor
bun add bee-anchor
```

## 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.6 |
| Published | 2020-04-24 |
| First published | 2019-03-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=4.0.0 |
| Dependencies | 4 |
| Unpacked size | 18.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Yonyou FED |
| Maintainers | banyudu, bjyxszd, guoyongfeng, huayingjie, jonyw, kvkens, liushaozhen, liuyk, npm_yx, tinper-bot, whizbz, yangchch, yonyoufed, zhaoyuchief |
| Keywords | react, react-component, bee-anchor, iuap-design, tinper-bee, Anchor |

## Links

- npm: https://www.npmjs.com/package/bee-anchor
- Repository: https://github.com/tinper-bee/bee-anchor
- Homepage: https://github.com/tinper-bee/bee-anchor.git
- Issues: https://github.com/tinper-bee/bee-anchor.git/issues
- npm.io page: https://npm.io/package/bee-anchor

## Dependencies (4)

- [gumshoejs](https://npm.io/package/gumshoejs.md) ^5.1.1
- [classnames](https://npm.io/package/classnames.md) ^2.2.5
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.23.0
- [tinper-bee-core](https://npm.io/package/tinper-bee-core.md) latest

## 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.6 (latest) — 2020-04-24
- 0.0.5-alpha.0 (alpha) — 2019-09-23
- 0.0.5 — 2019-09-23
- 0.0.4 — 2019-04-24
- 0.0.3 — 2019-04-16
- 0.0.2 — 2019-03-29
- 0.0.1 — 2019-03-28

## README

# bee-anchor

[![npm version](https://img.shields.io/npm/v/bee-anchor.svg)](https://www.npmjs.com/package/bee-anchor)
[![Build Status](https://img.shields.io/travis/tinper-bee/bee-anchor/master.svg)](https://travis-ci.org/tinper-bee/bee-anchor)
[![Coverage Status](https://coveralls.io/repos/github/tinper-bee/bee-anchor/badge.svg?branch=master)](https://coveralls.io/github/tinper-bee/bee-anchor?branch=master)
[![devDependency Status](https://img.shields.io/david/dev/tinper-bee/bee-anchor.svg)](https://david-dm.org/tinper-bee/bee-anchor#info=devDependencies)
[![NPM downloads](http://img.shields.io/npm/dm/bee-anchor.svg?style=flat)](https://npmjs.org/package/bee-anchor)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/tinper-bee/bee-anchor.svg)](http://isitmaintained.com/project/tinper-bee/bee-anchor "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/tinper-bee/bee-anchor.svg)](http://isitmaintained.com/project/tinper-bee/bee-anchor "Percentage of issues still open")


react bee-anchor component for tinper-bee

基于 [gumshoejs](https://www.npmjs.com/package/gumshoejs) 的锚点组件

## 依赖

- react >= 15.3.0
- react-dom >= 15.3.0
- prop-types >= 15.6.0

## 使用方法

```
import Anchor from 'bee-anchor';
import 'bee-anchor/build/Anchor.css';

```



## API

|参数|说明|类型|默认值|
|:---|:----:|:---:|------:|
|selector|目标元素选择器|string|-|
|offset|向上偏移量,例如有固定header，则 offset=()=>return header.getBoundingClientRect().height|()=>{}|0|
|navClass|当前被激活锚点新增的类名|string|'active'|
|contentClass|当前被激活区域新增的类名|string|'active'|
|nested|是否有嵌套导航|bool|false|
|nestedClass|嵌套导航激活时父节点的类名|string|'active'|
|event|是否添加监听事件|bool|true|
|activeHandle|被激活的回调，三个参数,以基本示例为例，列表li、锚点a、激活区域p|func|()=>{})|
|deactiveHandle|激活后的回调|func|()=>{})|


#### 开发调试

```sh
$ npm install -g bee-tools
$ git clone https://github.com/tinper-bee/bee-anchor
$ cd bee-anchor
$ npm install
$ npm run dev
```

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