# @gfazioli/mantine-text-animate 中文文档

规范地址：https://npmcn.com/package/%40gfazioli/mantine-text-animate/

版本：4\.0\.20
npm 元数据更新时间：2026-11-09T11:19:02.555Z
中文译文更新时间：2026-11-16T07:16:47.321Z
软件包许可：MIT

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

原始 npm 页面：https://www.npmjs.com/package/%40gfazioli/mantine-text-animate
原文对照：https://npmcn.com/package/%40gfazioli/mantine-text-animate/?lang=original
项目主页：https://gfazioli.github.io/mantine-text-animate/
源码仓库：https://github.com/gfazioli/mantine-text-animate

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

- 包体积（解压后）：1.1 MB，138 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- 运行依赖：0 个
- peer 依赖：react ^18\.x \|\| ^19\.x，react-dom ^18\.x \|\| ^19\.x，@mantine/core \>=9\.0\.0，@mantine/hooks \>=9\.0\.0
- 首次发布：2025-03-19T06:51:59.559Z
- 最新版本发布：2026-11-09T11:19:02.332Z
- 近 30 天下载量：11378（2026-10-17 至 2026-11-15，npm 官方下载统计）
- 已发布版本数：56（近 12 个月 35 个）

## 中文简介

TextAnimate 组件允许您对具有各种效果的文本进行动画化.

## 安装

```sh
npm install @gfazioli/mantine-text-animate
```

也可以使用：`pnpm add @gfazioli/mantine-text-animate`、`yarn add @gfazioli/mantine-text-animate`、`bun add @gfazioli/mantine-text-animate`

## README

# Mantine 文本动画组件

![Mantine Text Animate](https://github.com/gfazioli/mantine-text-animate/blob/master/logo.jpeg)

[![NPM version](https://img.shields.io/npm/v/%40gfazioli%2Fmantine-text-animate?style=for-the-badge)](https://www.npmjs.com/package/@gfazioli/mantine-text-animate) [![NPM Downloads](https://img.shields.io/npm/dm/%40gfazioli%2Fmantine-text-animate?style=for-the-badge)](https://www.npmjs.com/package/@gfazioli/mantine-text-animate) [![NPM Downloads](https://img.shields.io/npm/dy/%40gfazioli%2Fmantine-text-animate?style=for-the-badge&label=%20&color=f90)](https://www.npmjs.com/package/@gfazioli/mantine-text-animate) ![NPM License](https://img.shields.io/npm/l/%40gfazioli%2Fmantine-text-animate?style=for-the-badge)

* * *

  [如果此部分对您或您的团队有用,请考虑成为发起人](https://github.com/sponsors/gfazioli?o=esc)  

![mantine-text-animate at a glance, refreshed daily: commits, releases, stars, issues and pull requests, a year of commit activity, the weekly rhythm, languages, latest commits and releases, contributors](https://raw.githubusercontent.com/gfazioli/gfazioli/master/glancecard/mantine-text-animate.svg)  
制造的 [外观卡](https://github.com/gfazioli/glancecard) \* 每日刷新

## 概览

此组件创建于 [曼汀语Name](https://mantine.dev/) 图书馆. 这需要 **曼汀 9.x (英语)** 财务报告和审定财务报表 **反应 19**。 。 。 .

[Mantine 文本编辑器](https://gfazioli.github.io/mantine-text-animate/) 是React中文本的综合动画工具包,旨在与Mantine UI无缝地融合. 其核心是TextAnimate组件,允许您选择出/出/静状态,并应用诸如幻灯片,缩放和模糊等动画,同时通过持续时间,延迟和片段Delay按道具(字符,单词,行)和时间控制颗粒性. 精细调整通过动能Props- 翻译Distance, 缩放Amount, 和模糊Amount- 这样您就可以调整运动强度 。 在动画起步和动画起止上的事件处理器使得对动画生命周期的反应变得直截了当.

除了基本的文本过渡外,该套件还为常见模式提供了更高等的- 级原始: TextAnimate. 打字机和使用Typewriter hook提供光标和闪烁选项,速度/延迟控制,循环行为,多行渲染,以及钩子开始/停止/重置打字,加上TypeEnd和上TypeLoop调回.

对于数据演示,使用NumberTicker动画以速度,放行和完成回调来表示数值,同时使用TextTicker从可配置字符集的随机字符中揭示目标字符串,揭示方向,以及生命周期控制. Styling与Mantine道具完全相容,全局风格可被直接或在一个CSS层内导入,使系统对文档站点,仪表板,和丰富的UI交互具有灵活性.

> \[!注\]
> 
> → [演示文稿和文件](https://gfazioli.github.io/mantine-text-animate/) → [Youtube 视频](https://www.youtube.com/playlist?list=PL85tTROKkZrWyqCcmNCdWajpx05-cTal4) → [更多曼汀组件](https://mantine-extensions.vercel.app/)

## 安装

```sh
npm install @gfazioli/mantine-text-animate
```

或者说

```sh
yarn add @gfazioli/mantine-text-animate
```

在应用程序根部安装导入包样式后:

```tsx
import '@gfazioli/mantine-text-animate/styles.css';
```

## 使用量

```tsx
import { TextAnimate } from '@gfazioli/mantine-text-animate';

function Demo() {
  return (
<TextAnimate animate="in" animation="slideUp" by="character">
      Mantine TextAnimate component
    </TextAnimate>
  );
}
```

### 腾讯网. 打字机

[https://github.com/user-attachments/assets/a665af0a-7845-4946-99e1-1c5802e16d46 互联网档案馆的存檔,存档日期2014-12-02](https://github.com/user-attachments/assets/a665af0a-7845-4946-99e1-1c5802e16d46)

```tsx
import { TextAnimate } from '@gfazioli/mantine-text-animate';

function Demo() {
  return (
    <TextAnimate.Typewriter value="Hello, World! Mantine Typewriter component" animate />
  );
}
```

#### 使用编剧

```tsx
import { useTypewriter } from '@gfazioli/mantine-text-animate'

function Demo() {
    const { text, start, stop, reset, isTyping } = useTypewriter({
    value: ['Hello', 'From', 'Mantine useTypewriter() hook'],
  });

  return (
    <div>{text}</div>
  );
}
```

### 腾讯网. 旋转器

[https://github.com/user-attachments/assets/53266b12-86a6-4b4d-8da4-ec9caa22aef4 互联网档案馆的存檔,存档日期2013-12-02](https://github.com/user-attachments/assets/53266b12-86a6-4b4d-8da4-ec9caa22aef4)

```tsx
import { TextAnimate } from '@gfazioli/mantine-text-animate';

function Demo() {
  return (
    <TextAnimate.Spinner>★ SPINNING TEXT EXAMPLE ★</TextAnimate.Spinner>
  );
}
```

### 腾讯网. 数字

[https://github.com/user-attachments/assets/31e08c53-0d59-42a5-bc16-98baedda91cd (中文(简体) )](https://github.com/user-attachments/assets/31e08c53-0d59-42a5-bc16-98baedda91cd)

```tsx
import { TextAnimate } from '@gfazioli/mantine-text-animate';

function Demo() {
  return (
    <TextAnimate.NumberTicker value={100} animate />
  );
}
```

#### 使用编号标签

```tsx
import { useNumberTicker } from '@gfazioli/mantine-text-animate'

function Demo() {
  const { text, isAnimating, start, stop, reset, displayValue } = useNumberTicker({
    value: 64,
    startValue: 0,
    delay: 0,
    decimalPlaces: 0,
    speed: 0.2,
    easing: 'ease-out',
    animate: true,
  });

  return (
    <div>{text}</div>
  );
}
```

### 腾讯网. 文本标记

[https://github.com/user-attachments/assets/eaa647a4-2523-4d33-8aec-b303c447ffbb](https://github.com/user-attachments/assets/eaa647a4-2523-4d33-8aec-b303c447ffbb)

```tsx
import { TextAnimate } from '@gfazioli/mantine-text-animate';

function Demo() {
  return (
    <TextAnimate.TextTicker value="Hello, World! Mantine TextTicker component" animate />
  );
}
```

#### 使用文本标签

```tsx
import { useTextTicker } from '@gfazioli/mantine-text-animate'

function Demo() {
  const { text, isAnimating, start, stop, reset } = useTextTicker({
    value: 'Mantine useTextTicker',
    delay: 0,
    speed: 0.2,
    easing: 'ease-out',
    animate: true,
  });

  return (
    <div>{text}</div>
  );
}
```

## 发起人

  [如果此部分对您或您的团队有用,请考虑成为发起人](https://github.com/sponsors/gfazioli?o=esc)  

你的支持帮助了我:

-   积极维护项目,及时修复错误并更新安全信息
-   添加新特性, 提高性能,并完善开发者的经验
-   扩大测试范围和文件,以更顺利地采用
-   确保长期可持续性而不依赖临时自由时间
-   优先处理最重要的社区请求和路线图项目

开放源码的繁荣,如果受益的人能够回报——即使每月的小额捐款也会产生真正的变化。 赞助有助于覆盖维护时间、基础设施和无数使项目保持健康的无形任务.

你的帮助真的很重要.

💚 [成为提案国](https://github.com/sponsors/gfazioli?o=esc) 今天,帮助我保持这一项目的可靠性,更新,并为每个人成长.

* * *

[https://github.com/user-attachments/assets/8bbeb7ef-9e1f-46ab-a105-cdd1e0040780 互联网档案馆的存檔,存档日期2013-12-20](https://github.com/user-attachments/assets/8bbeb7ef-9e1f-46ab-a105-cdd1e0040780)

## 常见问题

### @gfazioli/mantine-text-animate 是什么？

TextAnimate 组件允许您对具有各种效果的文本进行动画化\.

### 如何安装 @gfazioli/mantine-text-animate？

在项目目录运行 npm install @gfazioli/mantine-text-animate，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：react（^18\.x \|\| ^19\.x）、react-dom（^18\.x \|\| ^19\.x）、@mantine/core（\>=9\.0\.0）、@mantine/hooks（\>=9\.0\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @gfazioli/mantine-text-animate 支持 TypeScript 吗？

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

### @gfazioli/mantine-text-animate 支持 ESM 还是 CommonJS？

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

### @gfazioli/mantine-text-animate 可以商用吗？

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

### @gfazioli/mantine-text-animate 的下载量有多少？

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

### @gfazioli/mantine-text-animate 还在维护吗？

最新版本 4\.0\.20 发布于 2026/11/09（6 天前）；至今共发布 56 个版本，其中过去 12 个月发布了 35 个；首次发布于 2025/03/19。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

