跳到主要内容
ZH

4 个图标 · MIT 许可

通知铃铛动态图标

有新动态时会摇动的铃铛,以及在铃铛和静音铃铛之间切换的图标。铃铛轻轻一摆,就能把视线引向未读数;可切换的版本还能直接用作频道或会话的静音开关。

这 4 个图标中,2 个持续循环播放,2 个点击时在两种状态之间切换。每个图标都提供 React 组件、shadcn/ui 组件和 Lottie JSON 动画,并附带静态 SVG,可依据 MIT 许可证免费用于商业项目。

全部通知铃铛图标

适用场景

  • 应用顶栏中的通知中心按钮
  • 收到新消息时摇动的未读徽标
  • 频道或会话的静音与取消静音开关
  • 邮件和推送通知设置
  • 提醒与订阅按钮

按交互方式

  • 循环动态图标 · 2

    持续播放;当用户偏好减少动态效果时,停留在静态的第一帧。Notification V3, Notification V4.

  • 点击切换动态图标 · 2

    点击时在两种状态之间切换;当用户偏好减少动态效果时,直接切换到新状态。Notification, Notification V2.

添加到您的应用

在 React 中,安装 react-useanimations 并导入图标即可,它会自动播放“点击切换”交互。本类别的所有图标用法都一样:把 notification 换成图标页面上的名称。

npm install react-useanimations
import UseAnimations from 'react-useanimations';
import notification from 'react-useanimations/lib/notification';

<UseAnimations animation={notification} size={32} />

使用 shadcn/ui 时,CLI 会添加一个现成的组件:

npx shadcn@latest add https://useanimations.com/r/notification.json
import { AnimatedNotification } from '@/components/animations/notification';

<AnimatedNotification size={24} />

没有使用 React?每个图标都是位于 /icons/<id>.json 的 Lottie JSON 文件;网页、iOS、Android 和 Flutter 的播放器用法请参阅 Lottie 图标。

常见问题

包含哪些通知铃铛动态图标?

共 4 个图标:Notification、Notification V2、Notification V3 和 Notification V4。全部可依据 MIT 许可证免费用于个人和商业项目,无需署名。

如何在 React 中使用这些通知铃铛动态图标?

安装 react-useanimations,添加 import notification from 'react-useanimations/lib/notification',然后渲染 <UseAnimations animation={notification} size={32} />。图标会播放它的“点击切换”交互,并跟随文字颜色。使用 shadcn/ui 时,改为运行 npx shadcn@latest add https://useanimations.com/r/notification.json。

不用 React 也能使用这些通知铃铛动态图标吗?

可以。每个图标都是一个 Lottie JSON 文件,地址为 https://useanimations.com/icons/<id>.json(例如 https://useanimations.com/icons/notification.json),可以用 lottie-web、lottie-ios、lottie-android 或 Flutter 的 lottie 包播放;静态 SVG 可以在各个图标页面(英文)下载。这些图标都没有用到表达式,因此 lottie-web 的轻量版(light build)就够用了。