@animatereactnative/stagger

中文文档
0.3.0发布于 2024/02/12MITTypeScriptESM + CJS零依赖近 30 天下载 1.1万

反应原生交错组件

中文使用文档
文档目录5 节
  1. 安装
  2. 使用量
  3. 道具
  4. 捐款
  5. 许可证

反应原生 Staggger

AnimateReactNative.com - Premium and Custom React Native animations.

NPM Version runs with expo npm npm Follow Miron Catalin

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

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

安装

npm install @animatereactnative/stagger

还有,你需要安装 反应-原生再激活,并遵循其安装指令.

使用量

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.ReactNode1个
enabled启用交错动画无boolean真实
stagger元素之间的间隔时间无number第50条
duration输入/退出动画持续时间无number400个
enterDirection动画的方向. 1 -> top to bottom, (中文(简体) ), -1 -> bottom to top无number0 个
exitDirection动画的方向. 1 -> top to bottom, (中文(简体) ), -1 -> bottom to top无number0 个
initialEnteringDelay初始输入动画延迟无编号1个
initialExistingDelay初始退出动画延迟无编号-1号
onEnterFinished调用以宣布上次项目动画完成时( 取决于方向)无() 无效未定义
onExitFinished调用以宣布上次项目动画完成时( 取决于方向)无() 无效未定义
enter重新激活的 Enter 动画无() => ComplexAnimationBuilderFadeInDown
exiting重新激活的退出动画无() => ComplexAnimationBuilderFadeOutDown
style查看将应用到 Marquee 容器的样式 .无StyleProp<ViewStyle>

捐款

见 贡献指南 学习如何为储存库和发展工作流程作出贡献.

许可证

麻省理工学院


AnimateReactNative.com - Premium and Custom React Native animations.

版本与发布记录

@animatereactnative/stagger 共发布 4 个版本,首次发布于 2023/08/31;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.3.0latest2024/02/122 年前
0.2.02023/11/152 年前
0.1.22023/11/142 年前
0.1.12023/08/313 年前

关于 @animatereactnative/stagger 的常见问题

@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 和提交记录判断。