# @animatereactnative/stagger 中文文档

规范地址：https://npmcn.com/package/%40animatereactnative/stagger/

版本：0\.3\.0
npm 元数据更新时间：2024-02-12T09:46:16.546Z
中文译文更新时间：2026-11-06T04:44:36.418Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40animatereactnative/stagger
原文对照：https://npmcn.com/package/%40animatereactnative/stagger/?lang=original
项目主页：https://github.com/animate-react-native/stagger#readme
源码仓库：https://github.com/animate-react-native/stagger

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：30.9 kB，10 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- Node.js 要求：\>= 16\.0\.0
- 运行依赖：0 个
- peer 依赖：react \*，react-native \*，react-native-reanimated \>=2\.2\.0
- 首次发布：2023-08-31T10:04:56.796Z
- 最新版本发布：2024-02-12T09:46:16.358Z
- 近 30 天下载量：11168（2026-10-06 至 2026-11-04，npm 官方下载统计）
- 已发布版本数：4（近 12 个月 0 个）

## 中文简介

反应原生交错组件

## 安装

```sh
npm install @animatereactnative/stagger
```

也可以使用：`pnpm add @animatereactnative/stagger`、`yarn add @animatereactnative/stagger`、`bun add @animatereactnative/stagger`

## README

# 反应原生 Staggger

![AnimateReactNative.com - Premium and Custom React Native animations.](https://npmcn.com/package/%40animatereactnative/stagger/animatereactnative-stagger-preview.gif)

[![NPM Version](https://img.shields.io/npm/v/@animatereactnative/stagger.svg?style=flat&color=black)](https://www.npmjs.org/package/@animatereactnative/stagger) [![runs with expo](https://img.shields.io/badge/Runs%20with%20Expo-4630EB.svg?style=flat-square&logo=EXPO&labelColor=f3f3f3&logoColor=000)](https://expo.io/) [![npm](https://img.shields.io/npm/l/@animatereactnative/stagger?style=flat-square)](https://www.npmjs.com/package/@animatereactnative/stagger) [![npm](https://img.shields.io/badge/types-included-blue?style=flat-square)](https://www.npmjs.com/package/@animatereactnative/stagger) [![Follow Miron Catalin](https://img.shields.io/twitter/follow/mironcatalin?label=Follow%20@mironcatalin&color=black)](https://twitter.com/mironcatalin)

反相原生 Stagger 组件,由再动电源所提供:

-   电源: **重新命名 3** 布局动画
-   与 **博览**
-   \- 跨平台(iOS、Android、Web - 需要) `reanimated@>=3.4.0`(中文(简体) )
-   60-120小时
-   QQ 具有任何反应原生元素/组件的工作
-   QQ 在类型脚本中写入

## 安装

```sh
npm install @animatereactnative/stagger
```

> 还有,你需要安装 [反应-原生再激活](https://github.com/software-mansion/react-native-reanimated),并遵循其安装指令.

## 使用量

```js
import { Stagger } from '@animatereactnative/stagger';

// ...

export function Example() {
  return (
    <Stagger
      stagger={50}
      duration={300}
      exitDirection={-1}
      entering={() => ZoomInEasyDown.springify()}
      exiting={() => FadeOutDown.springify()}
      style={{
        flexDirection: 'row',
        flexWrap: 'wrap',
        justifyContent: 'center',
        gap: 12,
      }}
    >
      <Paragraph>1. Custom duration</Paragraph>
      <Paragraph>2. Custom stagger</Paragraph>
      <Paragraph>3. Custom animation</Paragraph>
      <Paragraph>4. Custom enter/exit direction</Paragraph>
      <Heading>AnimateReactNative.com</Heading>
      <Heading>Powered by Reanimated 3</Heading>
      <Heading>Works with Expo ❤️</Heading>
    </Stagger>
  );
}
```

## 道具

| 名称 | 说明 | 所需经费 | 类型 | 默认 |
| --- | --- | --- | --- | --- |
| `children` | 您想要应用无限滚动/ Marquee 效果的任何组件 | 对 | `React.ReactNode` | 1个 |
| `enabled` | 启用交错动画 | 无 | `boolean` | 真实 |
| `stagger` | 元素之间的间隔时间 | 无 | `number` | 第50条 |
| `duration` | 输入/退出动画持续时间 | 无 | `number` | 400个 |
| `enterDirection` | 动画的方向. `1 -> top to bottom`, (中文(简体) ), `-1 -> bottom to top` | 无 | `number` | 0 个 |
| `exitDirection` | 动画的方向. `1 -> top to bottom`, (中文(简体) ), `-1 -> bottom to top` | 无 | `number` | 0 个 |
| `initialEnteringDelay` | 初始输入动画延迟 | 无 | 编号 | 1个 |
| `initialExistingDelay` | 初始退出动画延迟 | 无 | 编号 | \-1号 |
| `onEnterFinished` | 调用以宣布上次项目动画完成时( 取决于方向) | 无 | () 无效 | 未定义 |
| `onExitFinished` | 调用以宣布上次项目动画完成时( 取决于方向) | 无 | () 无效 | 未定义 |
| `enter` | [重新激活的 Enter 动画](https://www.reanimated3.com/docs/layout-animations/entering-exiting-animations) | 无 | `() => ComplexAnimationBuilder` | `FadeInDown` |
| `exiting` | [重新激活的退出动画](https://www.reanimated3.com/docs/layout-animations/entering-exiting-animations) | 无 | `() => ComplexAnimationBuilder` | `FadeOutDown` |
| `style` | 查看将应用到 Marquee 容器的样式 . | 无 | `StyleProp<ViewStyle>` |  |

## 捐款

见 [贡献指南](https://npmcn.com/package/%40animatereactnative/stagger/CONTRIBUTING.md) 学习如何为储存库和发展工作流程作出贡献.

## 许可证

[麻省理工学院](https://npmcn.com/package/%40animatereactnative/stagger/LICENSE)

* * *

[![AnimateReactNative.com - Premium and Custom React Native animations.](https://www.animatereactnative.com/animatereactnative_logo.svg)](https://www.animatereactnative.com/)

## 常见问题

### @animatereactnative/stagger 是什么？

反应原生交错组件

### 如何安装 @animatereactnative/stagger？

在项目目录运行 npm install @animatereactnative/stagger，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：react（\*）、react-native（\*）、react-native-reanimated（\>=2\.2\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @animatereactnative/stagger 支持 TypeScript 吗？

支持。包内自带 TypeScript 类型声明（package\.json 声明了 types 入口），安装后即可获得类型提示，无需再安装 @types 包。

### @animatereactnative/stagger 支持 ESM 还是 CommonJS？

同时提供 ES Module 与 CommonJS 入口，import 和 require\(\) 都可以使用，打包工具会自动选择合适的版本。

### @animatereactnative/stagger 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>= 16\.0\.0。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @animatereactnative/stagger 可以商用吗？

@animatereactnative/stagger 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @animatereactnative/stagger 的下载量有多少？

根据 npm 官方下载统计，@animatereactnative/stagger 在 2026/10/06 – 2026/11/04 这 30 天内被下载 11,168 次，日均约 372 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @animatereactnative/stagger 还在维护吗？

最新版本 0\.3\.0 发布于 2024/02/12（2 年前）；至今共发布 4 个版本，其中过去 12 个月发布了 0 个；首次发布于 2023/08/31。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

