# rc-banner-anim

> banner-anim animation component for react

Latest version **2.4.5** (published 2020-11-11) · 0 weekly downloads

## Install

```sh
npm install rc-banner-anim
pnpm add rc-banner-anim
yarn add rc-banner-anim
bun add rc-banner-anim
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.4.5 |
| Published | 2020-11-11 |
| First published | 2016-04-28 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 850.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | jljsj33 |
| Keywords | react, react-component, react-banner-anim, banner-anim |

## Links

- npm: https://www.npmjs.com/package/rc-banner-anim
- Repository: https://github.com/react-component/banner-anim
- Issues: https://github.com/react-component/banner-anim/issues
- npm.io page: https://npm.io/package/rc-banner-anim

## Dependencies (6)

- [prop-types](https://npm.io/package/prop-types.md) ^15.5.0
- [style-utils](https://npm.io/package/style-utils.md) ~0.2.0
- [rc-tween-one](https://npm.io/package/rc-tween-one.md) ^2.4.0
- [babel-runtime](https://npm.io/package/babel-runtime.md) 6.x
- [tween-functions](https://npm.io/package/tween-functions.md) 1.x
- [react-lifecycles-compat](https://npm.io/package/react-lifecycles-compat.md) ^3.0.4

## 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.4.5 (latest) — 2020-11-11
- 2.4.4 — 2020-05-28
- 2.4.3 — 2020-01-13
- 2.4.2 — 2019-09-05
- 2.4.1 — 2019-09-05
- 2.4.0 — 2019-08-27
- 2.3.0 — 2019-07-29
- 2.2.9 — 2019-07-23
- 2.2.8 — 2019-06-10
- 2.2.7 — 2019-06-03
- 2.2.6 — 2019-05-07
- 2.2.5 — 2019-04-15
- 2.2.4 — 2019-04-12
- 2.2.3 — 2019-04-12
- 2.2.2 — 2019-02-12
- … 53 more at https://npm.io/package/rc-banner-anim/versions

## README

# rc-banner-anim
---

React BannerAnim Component


[![NPM version][npm-image]][npm-url]
[![build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![node version][node-image]][node-url]
[![npm download][download-image]][download-url]

[npm-image]: http://img.shields.io/npm/v/rc-banner-anim.svg?style=flat-square
[npm-url]: http://npmjs.org/package/rc-banner-anim
[travis-image]: https://img.shields.io/travis/react-component/banner-anim.svg?style=flat-square
[travis-url]: https://travis-ci.org/react-component/banner-anim
[coveralls-image]: https://img.shields.io/coveralls/react-component/banner-anim.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/react-component/banner-anim?branch=master
[gemnasium-image]: http://img.shields.io/gemnasium/react-component/banner-anim.svg?style=flat-square
[node-image]: https://img.shields.io/badge/node.js-%3E=_0.10-green.svg?style=flat-square
[node-url]: http://nodejs.org/download/
[download-image]: https://img.shields.io/npm/dm/rc-banner-anim.svg?style=flat-square
[download-url]: https://npmjs.org/package/rc-banner-anim


## Browser Support

|![IE](https://github.com/alrra/browser-logos/blob/master/src/edge/edge_48x48.png?raw=true) | ![Chrome](https://github.com/alrra/browser-logos/blob/master/src/chrome/chrome_48x48.png?raw=true) | ![Firefox](https://github.com/alrra/browser-logos/blob/master/src/firefox/firefox_48x48.png?raw=true) | ![Opera](https://github.com/alrra/browser-logos/blob/master/src/opera/opera_48x48.png?raw=true) | ![Safari](https://github.com/alrra/browser-logos/blob/master/src/safari/safari_48x48.png?raw=true)|
| --- | --- | --- | --- | --- |
| IE 10+ ✔ | Chrome 31.0+ ✔ | Firefox 31.0+ ✔ | Opera 30.0+ ✔ | Safari 7.0+ ✔ |


## Development

```
npm install
npm start
```

## Example

http://localhost:8012/examples/


online example: http://react-component.github.io/banner-anim/


## install


[![rc-banner-anim](https://nodei.co/npm/rc-banner-anim.png)](https://npmjs.org/package/rc-banner-anim)


## Usage

```js
var BannerAnim = require('rc-banner-anim');
var React = require('react');
const { Element } = BannerAnim;
const BgElement = Element.BgElement;
React.render(<BannerAnim>
  <Element key="a">
    <BGElement key="bg" style={{ background: 'url(img)' }}/>
    <TweenOne key='0'>test text</TweenOne>
  </Element>
  <Element key="b">
    <BGElement key="bg" style={{ background: 'url(img)' }}/>
    <TweenOne key='0'>test text</TweenOne>
  </Element>
</BannerAnim>, container);
```

## API

### BannerAnim

```
`ref` control jump: <BannerAnim ref={(c) => { this.banner = c; }}/>

prev: this.banner.prev();

next: this.banner.next();

jump: this.banner.slickGoTo(number); number from 0;
```

|   name   |      type       |   default    |        description    |
|----------|-----------------|--------------|-----------------------|
|   type   |  string / array | All animType | Provide `across`, `vertical`, `acrossOverlay`, `verticalOverlay`, (`gridBar`, `grid`) => duration is a single block of animation time, video bg no use |
| duration |      number     |      450     | Single switch time.   |
| delay    |     number      |      0       |    switch delay.      |
| ease     |      string     | `easeInOutQuad` | easing.            |
| initShow |      number     |    0         |  start show           |
| arrow    |      boolean    |      `true`    |  `Arrow` is children, this is null and void. else is default arrow |
| thumb    |      boolean    |      `true`    |  ^ |
| autoPlay |      boolean    |      `false`  | auto play |
| autoPlaySpeed |  number    |    5000       | auto play delay |
| autoPlayEffect |  boolean    |    `true`       | auto play when mouse leave |
| onChange |     func        |    -          | onChange(`before` or `after`, currentShowInt) |
| prefixCls |    string      |   -           |  user class |
| children |  react.component|   -           | `Element`(must), `Arrow`, `Thumb` |
| sync      |   boolean      |   false       | `Element` the children and `Element` the same time animation |
| dragPlay  | boolean        |   true        | drag play next or prev |
| component | string | 'div' | component tag        |

### Element

> children is `TweenOne`, animation type must `from`;

|   name   |      type       |   default    |        description    |
|----------|-----------------|--------------|-----------------------|
| leaveChildHide |   boolean |  false   | children leave switch animation. Replace the `hideProps`.|
| sync      |   boolean      |   false       | children and `Element` the same time animation |
| prefixCls |     string      |   -           |  user class |
| followParallax | object   |  null        | follow mouse anim  |
| component | string | 'div' | component tag        |
| componentProps | object     | null   | component is React.Element, component tag props, not add `style` |

#### followParallax is object
|   name   |      type       |   default    |        description    |
|----------|-----------------|--------------|-----------------------|
| delay    |     number      |  null        | open followParallax delay |
| data     | array           |  null        | content: { key: string, value: number, type: array or string, bgPosition: string }; key: children key; value: animation interval value, example: value is 20 => [left: -20, center: 0 , right: 20] ; type: style or `x` `y`, bgPosition: if type is backgroundPosition, this is bg default position, else is invalid. |
| ease | string        |  `easeOutQuad`   | animate ease. [refer](http://easings.net/en)    |
| minMove    |   number        |  null        | ease.easeInOutQuad(start, minMove, 1, end); The mouse to move once, the minimum point of moving graphics, a second to reach the position of the mouse. |

### Element.BgElement

|   name   |      type       |   default    |        description    |
|----------|-----------------|--------------|-----------------------|
| className | string         | -            | className             |
| scrollParallax | object | null | { y: 100 },  from bottom to top of browser, element leave display area y is 100 |
| videoResize | boolean | true | children is video, video follow window resize |
| component | string | 'div' | component tag        |
| componentProps | object     | null   | component is React.Element, component tag props, not add `style` |

### Arrow

|   name   |      type       |   default    |        description    |
|----------|-----------------|--------------|-----------------------|
| arrowType |    'prev' \| 'next' |  -       | arrow type  |
| prefixCls |     string      |   -           |  user class |
| component  | string / React.Element  | `div`   | component tag  |
| componentProps | object     | null   | component is React.Element, component tag props, not add `style` |

### Thumb

|   name   |      type       |   default    |        description    |
|----------|-----------------|--------------|-----------------------|
| children  |     React.Element    |      -       |  must                 |
| prefixCls |     string      |   -           |  user class |
| component  | string / React.Element  | `div`   | component tag  |
| componentProps | object     | null   | component is React.Element, component tag props, not add `style` |

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