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

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

版本：3\.0\.10
npm 元数据更新时间：2026-11-09T11:09:28.545Z
中文译文更新时间：2026-11-16T07:11:16.322Z
软件包许可：MIT

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

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

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

- 包体积（解压后）：216 kB，22 个文件
- 模块格式：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，@tabler/icons-react ^3\.34\.0
- 首次发布：2025-12-04T12:39:55.904Z
- 最新版本发布：2026-11-09T11:09:28.171Z
- 近 30 天下载量：38505（2026-10-17 至 2026-11-15，npm 官方下载统计）
- 已发布版本数：32（近 12 个月 32 个）

## 中文简介

曼汀组件提供5个边框动画变体(波束,发光,脉冲,平分,破折),并带有进步驱动的边框,破折的图案,徘徊/聚焦/入视触发和全动画控制等功能,能完美地创造出动态,视觉接触UI元素.

## 安装

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

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

## README

# Mantine 边框动画组件

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

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

* * *

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

![mantine-border-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-border-animate.svg)  
制造的 [外观卡](https://github.com/gfazioli/glancecard) \* 每日刷新

## 概览

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

[曼汀边境](https://gfazioli.github.io/mantine-border-animate) 提供一种能将任何Mantine或平面反应元素转化为带有动画边框的视觉冲击组件的灵活包装. 它既为美学设计,也为性能设计,它利用CSS动画来提供平滑的60fps效果并曝光控制来裁剪外观和行为:你可以显示/隐藏边框,保持边框的静态或连续动画,并调整大小,半径,边框宽度,模糊度,持续时间等参数,以及颜色过渡等.

构成部分包括五个不同的变体—— **光束** (一行走在周边发光,有三个渲染模式), **发光** (有节奏的脉冲,可捕性模糊和不透明), **脉搏** (一种微妙的扩张和虚弱"呼吸"效应), **绘图** (测量值的边界)和 **破折号** (一个绕着周边行进的破碎边界).

关键特征包括:

-   **三个光束渲染模式** —— 说 `dot` (一个通过CSS相抵道沿边界行走的射线梯度点,每个位置均穿制服), `wedge` 和 `comet` (一个有被淡出尾巴的头,在任何形状上恒快地)
-   **测量的边界** —— 说 `variant="draw"` 与 `progress` (0-100)精确地绘制出实际周界的该份额,包括角,下面有一个可选轨道
-   **破旧边界** —— 说 `variant="dash"` 与 `dashSize`, (中文(简体) ), `dashGap`, (中文(简体) ), `count` 财务报告和审定财务报表 `dashCap`:行走的蚂蚁、圆点或固定数量的平分区段
-   **触发器** —— 说 `trigger` 启动动画 `hover`打开 `focus-within`,或者仅在组件是 `inView`
-   **接环** —— 说 `offset` 使边界远离内容,保持同心
-   **自定义颜色停止** ——多颜色梯度通过 `colorStops`
-   **暂停悬浮** —— 说 `pauseOnHover` 在用户交互时暂停动画的道具
-   **自定义计时函数** —— 说 `timingFunction` 完全控制动画放松的道具
-   **可访问** - 荣誉 `prefers-reduced-motion` 通过曼汀主题, 标记装饰的戒指 `aria-hidden`

通过蒙面和分层支持高级视觉设置: `withMask` 剪接边框区域的效果,同时使其失效并使用 `zIndex` 允许软背景在内容后发光。 通过提供样式表导入,整合是直截了当的,实例显示包裹常见的曼汀组件,如纸、卡、按钮、输入和提醒等.

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

> \[重要\]
> 
> **来自V2?** 第3版重命名了四个道具—— `angle` → `progress` (0-100而不是0-360), (中文(简体) ), `delay` → `phase`, (中文(简体) ), `size` → `spread` 用于旋转楔形和横梁模式 `path` 编号 : `conic` → `dot` 编号 : `wedge` ——并修正了发光和脉冲变体如何渲染,这改变了一些像素. 通过 v2 道具日志在开发中一次性发出警告.
> 
> → [升级指南](https://gfazioli.github.io/mantine-border-animate/?t=migrations)

## 安装

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

或者说

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

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

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

## 使用量

```tsx
import { Stack, Title } from '@mantine/core';
import { BorderAnimate } from '@gfazioli/mantine-border-animate';

function Demo() {
  return (
    <BorderAnimate w={300} p={32}>
      <Stack>
        <Title>This is a title</Title>
        <p>This is a paragraph inside the BorderAnimate component.</p>
      </Stack>
    </BorderAnimate>
  );
}
```

测量值的边界,其余的周边作为轨道:

```tsx
<BorderAnimate variant="draw" progress={65} withTrack colorFrom="blue.5" colorTo="cyan.4">
  <Paper radius="md" p="md">
    Uploading assets…
  </Paper>
</BorderAnimate>
```

一个边框,等待交互而不是循环. 在窗体字段 `focus-within` 沿着它内部的控制焦点, 所以没有状态可以连接:

```tsx
<Input.Wrapper label="Email">
  <BorderAnimate variant="draw" trigger="focus-within" radius="sm">
    <Input w="100%" placeholder="you@example.com" />
  </BorderAnimate>
</Input.Wrapper>
```

环绕控制,而不是整个领域:a `TextInput` 是一个 `Input.Wrapper`,所以包装它会把 标签周围的边框.

## 发起人

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

你的支持帮助了我:

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

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

你的帮助真的很重要.

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

## 常见问题

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

曼汀组件提供5个边框动画变体\(波束,发光,脉冲,平分,破折\),并带有进步驱动的边框,破折的图案,徘徊/聚焦/入视触发和全动画控制等功能,能完美地创造出动态,视觉接触UI元素\.

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

在项目目录运行 npm install @gfazioli/mantine-border-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）、@tabler/icons-react（^3\.34\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

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

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

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

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

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

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

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

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

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

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

