npm 中文文档 npm 中文文档
指南
npmjs.com (opens new window)
指南
npmjs.com (opens new window)
  • 快速入门

    • npm 是什么?
    • npm 安装和更新
    • npm 防止权限错误
    • npm package.json 文件
    • npm 安装包
    • npm 更新包
    • npm 卸载包
    • npm 创建 Node.js 模块
    • npm 发布和更新包
    • npm 使用语义化版本
    • npm 使用 Dist-tags 标记包
    • npm 包和模块的了解
  • 命令行
  • 配置 npm

react-anime


(ノ´ヮ´)ノ*:・゚✧ A super easy animation library for React built on top of Julian Garnier's anime.js. Just place an <Anime> component and what you want animated inside.


Documentation | Demos | Anime.js

Installation


  1. ``` shell
  2. npm i react-anime -S
  3. ```

Features


Animate nearly all CSS, SVG, & DOM attributes by adding a prop with their name (eg. opacity, backgroundColor, transform inputs like translateX ).

Nested animations are as easy as putting an <Anime> component inside another.

Cascading animations through delay prop.

Add elements dynamically and have them animate in.

TypeScript definitions included.

Usage


  1. ``` js
  2. import Anime, { anime } from 'react-anime';

  3. let colors = [ 'blue', 'green', 'red' ];

  4. const MyAnime = (props) => (
  5.     <Anime delay={anime.stagger(100)} scale={[ 0.1, 0.9 ]}>
  6.         {colors.map((color, i) => <div key={i} className={color} />)}
  7.     </Anime>
  8. );
  9. ```
Last Updated: 2023-05-15 10:22:02